Closed huubert closed 2 years ago
Could you try adding ffmpeg to PATH (or same folder as yt-dlp) instead of using --ffmpeg-location
Copied ffmpeg.exe to the same path as yt-dlp.exe and it works fine now. Thanks! I guess it's a bug though?
By the way, this is the same site as #2134. I don't think it needs a specific extractor. The site uses jwplayer and will only work with a portuguese IP address. The link points to a m3u8 like in the log I included above, which can be easily identified with Dev Tools -> Network.
Yeah, the issue is this:
which can be easily identified with Dev Tools -> Network.
Adding extractor is so you dont have to do that
Adding extractor is so you dont have to do that
Anything I should do to help or do you have enough info?
Another thing: the mp4.part file wasn't playable until I added --hls-use-mpegts
to the command. It seems it's not being applied by default like it says in --help
, even though it is a livestream.
When you pass m3u8 directly, yt-dlp can't reliably detect whether it is a live stream or not. It would work of it were a supported site
How a vod link looks like: https://streaming-vod3.iol.pt/vod/_definst_/6/0/3/d/smil:61c3ad0b0cf21a10a415603d-L/playlist.m3u8?wmsAuthSign=redacted_id
For vods, no options need to be set. Just yt-dlp.exe "link"
will work.
For lives: yt-dlp.exe --hls-use-mpegts --downloader "m3u8:ffmpeg" "url"
That digit in the url will vary: streaming-vod3.iol.pt video-auth2.iol.pt
When you pass m3u8 directly, yt-dlp can't reliably detect whether it is a live stream or not. It would work of it were a supported site
Could yt-dlp try looking for #EXT-X-ENDLIST
at the end of the m3u8 file, and if it is not found, then handle the playlist as a livestream?
This also affects --download-sections
now:
yt-dlp-daily "https://www.youtube.com/watch?v=ci6ZtPAN0PM" --download-sections "*00:10-00:20" --no-update -f 248 --verbose
[debug] Command-line config: ['https://www.youtube.com/watch?v=ci6ZtPAN0PM', '--download-sections', '*00:10-00:20', '--no-update', '-f', '248', '--verbose']
[debug] User config "C:\Users\REDACTED\AppData\Roaming\yt-dlp\config.txt": ['--ffmpeg-location', 'C:\\Users\\REDACTED\\ffmpeg\\bin', '-P', 'C:\\Users\\REDACTED\\youtube.dl', '--update', '--audio-quality', '0', '--write-subs', '--write-auto-subs', '--embed-subs', '--compat-options', 'no-keep-subs,no-live-chat']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.06.18.43044 [61b4932] (win32_exe)
[debug] ** This build is unofficial daily builds, provided for ease of use.
[debug] ** Please do not ask for any support.
[debug] Compatibility options: no-keep-subs, no-live-chat
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19043-SP0
[debug] Checking exe version: "C:\Users\REDACTED\ffmpeg\bin\ffmpeg" -bsfs
[debug] Checking exe version: "C:\Users\REDACTED\ffmpeg\bin\ffprobe" -bsfs
[debug] exe versions: ffmpeg N-106498-g854615adf2-20220405 (setts), ffprobe N-106498-g854615adf2-20220405
[debug] Optional libraries: Cryptodome-3.14.1, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=ci6ZtPAN0PM
[youtube] ci6ZtPAN0PM: Downloading webpage
[youtube] ci6ZtPAN0PM: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] ci6ZtPAN0PM: Downloading 1 format(s): 248
[info] ci6ZtPAN0PM: Downloading 1 time ranges: 10-20
ERROR: This format cannot be partially downloaded. Aborting
File "yt_dlp\__main__.py", line 16, in <module>
File "yt_dlp\__init__.py", line 897, in main
File "yt_dlp\__init__.py", line 889, in _real_main
File "yt_dlp\YoutubeDL.py", line 3235, in download
File "yt_dlp\YoutubeDL.py", line 3211, in wrapper
File "yt_dlp\YoutubeDL.py", line 1413, in extract_info
File "yt_dlp\YoutubeDL.py", line 1422, in wrapper
File "yt_dlp\YoutubeDL.py", line 1506, in __extract_info
File "yt_dlp\YoutubeDL.py", line 1563, in process_ie_result
File "yt_dlp\YoutubeDL.py", line 2616, in process_video_result
File "yt_dlp\YoutubeDL.py", line 2995, in process_info
File "yt_dlp\YoutubeDL.py", line 962, in report_error
File "yt_dlp\YoutubeDL.py", line 894, in trouble
Youtube clips download also fails with: ERROR: You have requested downloading the video partially, but ffmpeg is not installed. Aborting
Test link: https://youtube.com/clip/Ugkx7Jls-tHrB-KPmJ8etrfZ7CCvJK7_9I-1
Log:
./yt-dlp -vU --ffmpeg-location ffmpeg "https://youtube.com/clip/Ugkx7Jls-tHrB-KPmJ8etrfZ7CCvJK7_9I-1"
[debug] Command-line config: ['-vU', '--ffmpeg-location', 'ffmpeg', 'https://youtube.com/clip/Ugkx7Jls-tHrB-KPmJ8etrfZ7CCvJK7_9I-1']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.07.18 [135f05ef6] (zip)
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Python 3.9.13 (CPython 64bit) - macOS-12.4-arm64-arm-64bit
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: /yt-dlp/avconv -bsfs
[debug] Checking exe version: /yt-dlp/ffprobe -bsfs
[debug] Checking exe version: /yt-dlp/avprobe -bsfs
[debug] exe versions: none
[debug] Optional libraries: sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.07.18, Current version: 2022.07.18
yt-dlp is up to date (2022.07.18)
[debug] [youtube:clip] Extracting URL: https://youtube.com/clip/Ugkx7Jls-tHrB-KPmJ8etrfZ7CCvJK7_9I-1
[youtube:clip] Ugkx7Jls-tHrB-KPmJ8etrfZ7CCvJK7_9I-1: Downloading webpage
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=VGk3tY4yP7k
[youtube] VGk3tY4yP7k: Downloading webpage
[youtube] VGk3tY4yP7k: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: best/bestvideo+bestaudio
[info] Ugkx7Jls-tHrB-KPmJ8etrfZ7CCvJK7_9I-1: Downloading 1 format(s): 18
ERROR: You have requested downloading the video partially, but ffmpeg is not installed. Aborting
File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "./yt-dlp/main.py", line 17, in
The issue is that --ffmpeg-location
is not passed through to the "downloader selection" code. Solving this "properly" requires a lot of changes. However, since we no longer have to worry about Py3.6, this can be fixed using contextvars
The issue is that
--ffmpeg-location
is not passed through to the "downloader selection" code. Solving this "properly" requires a lot of changes. However, since we no longer have to worry about Py3.6, this can be fixed usingcontextvars
Always thought --ffmpeg-location is specified to be used in whatever location/ use case necessary. So, was surprised I was wrong. BTW, how can ffprobe path be specified? It seems to me, I came across some link recently, where yt-dlp asked be for ffprobe (I might be a bit wrong here). I forgot about the case and never came back to it, but while we are at it, decided to ask. Apologies, if that's a bit off topic here.
It uses the same path as --ffmpeg-location
It uses the same path as
--ffmpeg-location
so syntax should be yt-dlp --ffmpeg-location ffmpegPath --ffmpeg-location ffprobePath blabla?
No, we just look for it in the same location as whatever --ffmpeg-location
was given
Just figured out, passing --ffmpeg-location
to binary or module (python -m yt_dlp
) works.
But when importing yt_dlp
as python library and using yt_dlp.YoutubeDL(ydl_opts)
or something, even if you provide 'ffmpeg_location'
to ydl_opts
, it will not work.
Turns out, FFmpegPostProcessor._ffmpeg_location.set(opts.ffmpeg_location)
workaround being applied only when module being run through __main__
.
It can be workarounded manually by ydl_opts.FFmpegPostProcessor._ffmpeg_location.set(...)
but bruh
I spent two hours to figure that out 🙈
Checklist
Description
Hi,
I'm trying to download a livestream, but it doesn't work. It still works fine with youtube-dl, but not with yt-dlp. I suspect the problem is that yt-dlp keeps using hlsnative as the external downloader, even when I clearly specify to use ffmpeg. Because of this, it only downloads the first chunk of video and stops.
This is the youtube-dl command that works fine
"youtube-dl.exe" --hls-use-mpegts --ffmpeg-location "ffmpeg-2021-12-30-git-12f21849e5-essentials_build\bin" "same_url_as_in_the_log"
Any help would be appreciated
Verbose log