This is just a sample code, I was using range_func without any problems and then youtube links somehow starts from the the beginning of the video no matter what start time I gave. Odd thing is it was working perfect and somehow it's only gets end time but start is always 0. I tried with other platforms but they were fine just youtube does this. Any ideas or alternatives? (ffmpeg -ss is not an alternative since it's already downloading the whole video and then cuts it so it's useless.)
from yt_dlp import YoutubeDL
from yt_dlp.utils import download_range_func
vlink = input('paste link: ')
start = int(input('start time: '))
end = start + 6
ydl_opts = {
    'format': 'bestaudio/best',
            'download_ranges': download_range_func(None, [(start, end)]),
            'outtmpl': 'output.%(ext)s', 
            'postprocessors': [{
                'key': 'FFmpegExtractAudio',
                'preferredcodec': 'wav',
            }],
            'postprocessor_args': [
                '-ar', '44100',
                '-ac', '1',
                '-acodec', 'pcm_s16le',
            ],
            'prefer_ffmpeg': True
}
with YoutubeDL(ydl_opts) as ydl:
    ydl.download(vlink)
Well I added two args(explained with comments) and problem solved.
from yt_dlp import YoutubeDL
from yt_dlp.utils import download_range_func
vlink = input('paste link: ')
start = int(input('start time: '))
end = start + 6
ydl_opts = {
    'format': 'bestaudio/best',
            'download_ranges': download_range_func(None, [(start, end)]),
            'force_keyframes_at_cuts': True, # for yt links
            'outtmpl': 'output.%(ext)s', 
            'postprocessors': [{
                'key': 'FFmpegExtractAudio',
                'preferredcodec': 'wav',
            }],
            'postprocessor_args': [
                '-ar', '44100',
                '-ac', '1',
                '-acodec', 'pcm_s16le',
                '-f', 'WAV', #for other platforms which uses .m4a
            ],
            'prefer_ffmpeg': True
}
with YoutubeDL(ydl_opts) as ydl:
    ydl.download(vlink)