ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.47k stars 9.96k forks source link

mixcloud needs live addition #25625

Open aleasevr opened 4 years ago

aleasevr commented 4 years ago

Checklist

Description

WRITE DESCRIPTION HERE Youtube.dl does not have support for mixclouds new streaming service. The livestream is located at https://www.mixcloud.com/live/ followed by the persons username. You will need to remove beta from the url in the repo as mixcloud is no longer in beta with this feature as it is now live on server.

davr commented 4 years ago

Can confirm same issue, for example https://www.mixcloud.com/live/electroradiofm/ is live right now (but may not be when you read this message). When I try to run youtube-dl on the URL I get this:

>youtube-dl --verbose https://www.mixcloud.com/live/electroradiofm/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.mixcloud.com/live/electroradiofm/']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2020.06.16.1
[debug] Python version 3.7.1 (CPython) - Windows-10-10.0.19559-SP0
[debug] exe versions: ffmpeg 4.1.3, ffprobe 4.1.3
[debug] Proxy map: {}
[mixcloud] live_electroradiofm: Downloading JSON metadata
Traceback (most recent call last):
  File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python37\Scripts\youtube-dl.exe\__main__.py", line 9, in <module>
  File "c:\python37\lib\site-packages\youtube_dl\__init__.py", line 474, in main
    _real_main(argv)
  File "c:\python37\lib\site-packages\youtube_dl\__init__.py", line 464, in _real_main
    retcode = ydl.download(all_urls)
  File "c:\python37\lib\site-packages\youtube_dl\YoutubeDL.py", line 2019, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "c:\python37\lib\site-packages\youtube_dl\YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "c:\python37\lib\site-packages\youtube_dl\extractor\common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "c:\python37\lib\site-packages\youtube_dl\extractor\mixcloud.py", line 131, in _real_extract
    title = cloudcast['name']
TypeError: 'NoneType' object is not subscriptable

When I use chrome dev tools, I find some m3u8 files being retrieved, I tried passing them into youtube-dl (this has worked on other sites that aren't supported) it did not work, get these errors:

>youtube-dl --verbose https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/master.m3u8
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/master.m3u8']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2020.06.16.1
[debug] Python version 3.7.1 (CPython) - Windows-10-10.0.19559-SP0
[debug] exe versions: ffmpeg 4.1.3, ffprobe 4.1.3
[debug] Proxy map: {}
[generic] master: Requesting header
[generic] master: Downloading m3u8 information
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/index-720p.m3u8'
[download] Destination: master-master.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3539.0 Safari/537.36
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-us,en;q=0.5
" -i "https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/index-720p.m3u8" -c copy -f mp4 "file:master-master.mp4.part"
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8.3.1 (GCC) 20190414
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[tcp @ 000001ee613bc780] Starting connection attempt to 205.234.175.175 port 443
[tcp @ 000001ee613bc780] Successfully connected to 205.234.175.175 port 443
[hls,applehttp @ 000001ee613b9380] HLS request for url 'https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/init-1592466977073.mp4', offset 0, playlist 0
[hls,applehttp @ 000001ee613b9380] Opening 'https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/init-1592466977073.mp4' for reading
[tcp @ 000001ee6197d180] Starting connection attempt to 205.234.175.175 port 443
[tcp @ 000001ee6197d180] Successfully connected to 205.234.175.175 port 443
[AVIOContext @ 000001ee61b03e40] Statistics: 1311 bytes read, 0 seeks
[hls,applehttp @ 000001ee613b9380] HLS request for url 'https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/index-720p1592466979363141.m4s', offset 0, playlist 0
[hls,applehttp @ 000001ee613b9380] Opening 'https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/index-720p1592466979363141.m4s' for reading
[tcp @ 000001ee61980080] Starting connection attempt to 205.234.175.175 port 443
[tcp @ 000001ee61980080] Successfully connected to 205.234.175.175 port 443
[hls,applehttp @ 000001ee613b9380] HLS request for url 'https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/index-720p1592466979363142.m4s', offset 0, playlist 0
[hls,applehttp @ 000001ee613b9380] Opening 'https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/index-720p1592466979363142.m4s' for reading
[tcp @ 000001ee619dd980] Starting connection attempt to 205.234.175.175 port 443
[tcp @ 000001ee619dd980] Successfully connected to 205.234.175.175 port 443
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001ee6197c900] Reconfiguring buffers to size 309096
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001ee6197c900] stream 0, offset 0x98f: partial file
[hls,applehttp @ 000001ee613b9380] Could not find codec parameters for stream 0 (Video: h264, 1 reference frame (avc1 / 0x31637661), none(left), 1280x720, 0 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, hls,applehttp, from 'https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/index-720p.m3u8':
  Duration: N/A, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264, 1 reference frame (avc1 / 0x31637661), none(left), 1280x720, 0 kb/s, 15360 tbr, 15360 tbn, 30720 tbc
    Metadata:
      variant_bitrate : 0
      major_brand     : iso5
      minor_version   : 512
      compatible_brands: iso5iso6mp41
      encoder         : Lavf58.43.100
    Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 0 kb/s
    Metadata:
      variant_bitrate : 0
[mp4 @ 000001ee62058740] track 1: codec frame size is not set
Output #0, mp4, to 'file:master-master.mp4.part':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264, 1 reference frame (avc1 / 0x31637661), none(left), 1280x720 (0x0), q=2-31, 0 kb/s, 15360 tbr, 15360 tbn, 15360 tbc
    Metadata:
      variant_bitrate : 0
      major_brand     : iso5
      minor_version   : 512
      compatible_brands: iso5iso6mp41
      encoder         : Lavf58.43.100
    Stream #0:1: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 0 kb/s
    Metadata:
      variant_bitrate : 0
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001ee6197c900] stream 0, offset 0x98f: partial file
https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/index-720p.m3u8: Invalid data found when processing input
No more output streams to write to, finishing.
frame=    0 fps=0.0 q=-1.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (https://live2mxcloud.cachefly.net/play/f19159e9-0bad-4dda-a2b8-2191b1de489a/index-720p.m3u8):
  Input stream #0:0 (video): 0 packets read (0 bytes);
  Input stream #0:1 (audio): 0 packets read (0 bytes);
  Total: 0 packets (0 bytes) demuxed
Output file #0 (file:master-master.mp4.part):
  Output stream #0:0 (video): 0 packets muxed (0 bytes);
  Output stream #0:1 (audio): 0 packets muxed (0 bytes);
  Total: 0 packets (0 bytes) muxed
[AVIOContext @ 000001ee6200c000] Statistics: 2 seeks, 3 writeouts
[AVIOContext @ 000001ee61d146c0] Statistics: 33755 bytes read, 0 seeks
[AVIOContext @ 000001ee6200c2c0] Statistics: 0 bytes read, 0 seeks
[AVIOContext @ 000001ee61888840] Statistics: 2188 bytes read, 0 seeks
[ffmpeg] Downloaded 262 bytes
[download] 100% of 262.00B in 00:00
davr commented 4 years ago

Also one other point of data, plus a tip for anyone else waiting on youtube-dl updates, this chrome extension is able to save mixcloud live streams when run in "Capture Mode" https://chrome.google.com/webstore/detail/stream-recorder-download/iogidnfllpdhagebkblkgbfijkbkjdmm?hl=en (the documentation's not the greatest so not sure how helpful this is)

LucHeart commented 3 years ago

This issue still persists.

PS > .\youtube-dl.exe "https://www.mixcloud.com/live/urgentfm/"
[mixcloud] live_urgentfm: Downloading JSON metadata
Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\__init__.py", line 475, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\__init__.py", line 465, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 2069, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 808, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\common.py", line 534, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpkqxnwl31\build\youtube_dl\extractor\mixcloud.py", line 131, in _real_extract
TypeError: 'NoneType' object is not subscriptable

Even with -i as an argument, this still does not work.