Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--hls-prefer-native works on Windows but not on Ubuntu #23346

Closed
stvrly opened this issue Dec 8, 2019 · 6 comments
Closed

--hls-prefer-native works on Windows but not on Ubuntu #23346

stvrly opened this issue Dec 8, 2019 · 6 comments
Labels

Comments

@stvrly
Copy link

@stvrly stvrly commented Dec 8, 2019

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

youtube-dl version 2019.11.28 is installed in both Windows 10 and Ubuntu 19.10. Both are installed directly from the download page (not using the Ubuntu package).

In Windows, most downloads default to hlsnative; for the few that don't I can set the --hls-prefer-native option and it works.

In Ubuntu, hlsnative never works, even with the option set. youtube-dl displays this message:

WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg

and then proceeds with ffmpeg. I installed python-pycryptodome (which the Arch Linux AUR page says is necessary for hlsnative) but this didn't seem to do anything. youtube-dl always wants to use ffmpeg for extraction.

What's missing to get hlsnative to work in Ubuntu?

@stvrly stvrly added the question label Dec 8, 2019
@remitamine
Copy link
Collaborator

@remitamine remitamine commented Dec 8, 2019

post the verbose output of the command you're using.

@stvrly
Copy link
Author

@stvrly stvrly commented Dec 8, 2019

Alrighty. Two outputs below, one for each operating system. I canceled the transfer after the connection had successfully established and the download had started.

Windows

> youtube-dl -v --hls-prefer-native https://www.syfy.com/battlestargalactica/videos/101-33
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--hls-prefer-native', 'https://www.syfy.com/battlestargalactica/videos/101-33']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2019.11.28
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1
[debug] Proxy map: {}
[Syfy] 101-33: Downloading webpage
[ThePlatform] RNL5ukLPCPhL: Downloading SMIL data
[ThePlatform] RNL5ukLPCPhL: Downloading m3u8 information
[ThePlatform] RNL5ukLPCPhL: Downloading JSON metadata
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/index_0_av.m3u8?null=0&id=AgA%2f4CpqQ4dpnHed7F0x4BIhqfhQi5X1hweuR2O+JwPR2B%2faFfljDoHStgYiSn50D1oD5+3ol2OdwQ%3d%3d&hdntl=exp=1575874295~acl=%2fi%2fprod%2fvideo%2f161%2f931%2f170831_3577425_33_anvver_7_*~data=hdntl~hmac=5fa1694cfebd5c4e5d9816a1f9063d0dbc1b38b6c31d067f4a52469d6b1295e8'
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 260
[download] Destination: 33-RNL5ukLPCPhL.mp4
[download]   0.1% of ~2.66GiB at  7.76MiB/s ETA 12:44
ERROR: Interrupted by user

Linux

$ youtube-dl -v --hls-prefer-native https://www.syfy.com/battlestargalactica/videos/101-33
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--hls-prefer-native', u'https://www.syfy.com/battlestargalactica/videos/101-33']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.11.28
[debug] Python version 2.7.17rc1 (CPython) - Linux-5.3.0-23-generic-x86_64-with-Ubuntu-19.10-eoan
[debug] exe versions: ffmpeg 4.1.4-1build2, ffprobe 4.1.4-1build2, rtmpdump 2.4
[debug] Proxy map: {}
[Syfy] 101-33: Downloading webpage
[ThePlatform] RNL5ukLPCPhL: Downloading SMIL data
[ThePlatform] RNL5ukLPCPhL: Downloading m3u8 information
[ThePlatform] RNL5ukLPCPhL: Downloading JSON metadata
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on u'https://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/index_0_av.m3u8?null=0&id=AgA%2f4CpqQ4dpnLGe7F3SB8cwcSyJJyQNui3mEWo+IGl1D0W45di5gtwTtBRCijRi+F3GYtKfgks%2fYw%3d%3d&hdntl=exp=1575874609~acl=%2fi%2fprod%2fvideo%2f161%2f931%2f170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8'
[hlsnative] Downloading m3u8 manifest
WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg
[download] Destination: 33-RNL5ukLPCPhL.mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers 'Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.66 Safari/537.36
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Cookie: _alid_=6t0DpPVOzE0ZJ9EZGnvbmg==; hdntl=exp=1575874609~acl=%2fi%2fprod%2fvideo%2f161%2f931%2f170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8
' -i 'https://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/index_0_av.m3u8?null=0&id=AgA%2f4CpqQ4dpnLGe7F3SB8cwcSyJJyQNui3mEWo+IGl1D0W45di5gtwTtBRCijRi+F3GYtKfgks%2fYw%3d%3d&hdntl=exp=1575874609~acl=%2fi%2fprod%2fvideo%2f161%2f931%2f170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8' -c copy -f mp4 '-bsf:a' aac_adtstoasc 'file:33-RNL5ukLPCPhL.mp4.part'
ffmpeg version 4.1.4-1build2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.2.1-4ubuntu1)
  configuration: --prefix=/usr --extra-version=1build2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  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
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[tcp @ 0x559c827653c0] Starting connection attempt to 67.135.105.160 port 443
[tcp @ 0x559c827653c0] Successfully connected to 67.135.105.160 port 443
[hls,applehttp @ 0x559c82761d00] HLS request for url 'http://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/segment1_0_av.ts?null=0&id=AgA%2f4CpqQ4dpnLGe7F3SB8cwcSyJJyQNui3mEWo+IGl1D0W45di5gtwTtBRCijRi+F3GYtKfgks%2fYw%3d%3d&hdntl=exp=1575874609~acl=/i/prod/video/161/931/170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8', offset 0, playlist 0
[hls,applehttp @ 0x559c82761d00] Opening 'https://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/crypt.key?null=0&id=AgA%2f4CpqQ4dpnLGe7F3SB8cwcSyJJyQNui3mEWo+IGl1D0W45di5gtwTtBRCijRi+F3GYtKfgks%2fYw%3d%3d&hdntl=exp=1575874609~acl=/i/prod/video/161/931/170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8' for reading
[tcp @ 0x559c82a8e3c0] Starting connection attempt to 67.135.105.160 port 443
[tcp @ 0x559c82a8e3c0] Successfully connected to 67.135.105.160 port 443
[AVIOContext @ 0x559c82a94440] Statistics: 16 bytes read, 0 seeks
[hls,applehttp @ 0x559c82761d00] Opening 'crypto+http://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/segment1_0_av.ts?null=0&id=AgA%2f4CpqQ4dpnLGe7F3SB8cwcSyJJyQNui3mEWo+IGl1D0W45di5gtwTtBRCijRi+F3GYtKfgks%2fYw%3d%3d&hdntl=exp=1575874609~acl=/i/prod/video/161/931/170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8' for reading
[tcp @ 0x559c82a94200] Starting connection attempt to 67.135.105.160 port 80
[tcp @ 0x559c82a94200] Successfully connected to 67.135.105.160 port 80
[h264 @ 0x559c82a99200] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #0, hls,applehttp, from 'https://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/index_0_av.m3u8?null=0&id=AgA%2f4CpqQ4dpnLGe7F3SB8cwcSyJJyQNui3mEWo+IGl1D0W45di5gtwTtBRCijRi+F3GYtKfgks%2fYw%3d%3d&hdntl=exp=1575874609~acl=%2fi%2fprod%2fvideo%2f161%2f931%2f170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8':
  Duration: 00:43:19.03, start: 0.100511, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264 (Main), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(left), 1920x1080 (1920x1088), Closed Captions, 29.97 tbr, 90k tbn, 59.94 tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
    Stream #0:2: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 0
Output #0, mp4, to 'file:33-RNL5ukLPCPhL.mp4.part':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (Main), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 1920x1080 (0x0), q=2-31, 29.97 tbr, 90k tbn, 90k tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[AVIOContext @ 0x559c82a8b780] Statistics: 10972244 bytes read, 0 seeks4.9kbits/s speed=7.87x
[hls,applehttp @ 0x559c82761d00] HLS request for url 'http://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/segment2_0_av.ts?null=0&id=AgA%2f4CpqQ4dpnLGe7F3SB8cwcSyJJyQNui3mEWo+IGl1D0W45di5gtwTtBRCijRi+F3GYtKfgks%2fYw%3d%3d&hdntl=exp=1575874609~acl=/i/prod/video/161/931/170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8', offset 0, playlist 0
[hls,applehttp @ 0x559c82761d00] Opening 'crypto+http://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/segment2_0_av.ts?null=0&id=AgA%2f4CpqQ4dpnLGe7F3SB8cwcSyJJyQNui3mEWo+IGl1D0W45di5gtwTtBRCijRi+F3GYtKfgks%2fYw%3d%3d&hdntl=exp=1575874609~acl=/i/prod/video/161/931/170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8' for reading
[tcp @ 0x559c82a94200] Starting connection attempt to 67.135.105.160 port 80
[tcp @ 0x559c82a94200] Successfully connected to 67.135.105.160 port 80
^Cframe=  312 fps=169 q=-1.0 Lsize=   10802kB time=00:00:10.42 bitrate=8487.4kbits/s speed=5.63x
video:10677kB audio:111kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.120831%
Input file #0 (https://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/index_0_av.m3u8?null=0&id=AgA%2f4CpqQ4dpnLGe7F3SB8cwcSyJJyQNui3mEWo+IGl1D0W45di5gtwTtBRCijRi+F3GYtKfgks%2fYw%3d%3d&hdntl=exp=1575874609~acl=%2fi%2fprod%2fvideo%2f161%2f931%2f170831_3577425_33_anvver_7_*~data=hdntl~hmac=eb57219b39830fb913f35f324c864a19502ae926166e87d7af36edd6fb68a9b8):
  Input stream #0:0 (video): 312 packets read (10933539 bytes);
  Input stream #0:1 (audio): 450 packets read (117239 bytes);
  Input stream #0:2 (data): 0 packets read (0 bytes);
  Total: 762 packets (11050778 bytes) demuxed
Output file #0 (file:33-RNL5ukLPCPhL.mp4.part):
  Output stream #0:0 (video): 312 packets muxed (10933539 bytes);
  Output stream #0:1 (audio): 450 packets muxed (114089 bytes);
  Total: 762 packets (11047628 bytes) muxed
[AVIOContext @ 0x559c82d4db00] Statistics: 2 seeks, 46 writeouts
[AVIOContext @ 0x559c82a8f700] Statistics: 426224 bytes read, 0 seeks
[AVIOContext @ 0x559c8276a840] Statistics: 104958 bytes read, 0 seeks
Exiting normally, received signal 2.

ERROR: Interrupted by user
@remitamine
Copy link
Collaborator

@remitamine remitamine commented Dec 8, 2019

you don't have PyCrypto or PyCryptodome for the Python version you're using(2.x), PyCryptodomeX is not supported.

@stvrly
Copy link
Author

@stvrly stvrly commented Dec 8, 2019

Uh, PyCrytodome is installed:

$ dpkg -l |grep pycrypto
ii  python-pycryptodome                  3.6.1-2build2                          amd64        cryptographic Python library (Python 2)

What is PyCryptodomeX? I don't see a reference to that, what part of my debug output indicates this?

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Dec 8, 2019

there is a problem with you're installation and it has nothing to do with youtube-dl, PyCrypto.Cipher.AES cannot be imported in you envirenment:

python2 __main__.py -v --ignore-config --hls-prefer-native --proxy localhost:8080 https://www.syfy.com/battlestargalactica/videos/101-33
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--ignore-config', u'--hls-prefer-native', u'--proxy', u'localhost:8080', u'https://www.syfy.com/battlestargalactica/videos/101-33']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.11.28
[debug] Git HEAD: ce709fcb0
[debug] Python version 2.7.17 (CPython) - Linux-5.4.1-arch1-1-x86_64-with-glibc2.2.5
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1, rtmpdump 2.4
[debug] Proxy map: {u'http': u'localhost:8080', u'https': u'localhost:8080'}
[Syfy] 101-33: Downloading webpage
[ThePlatform] RNL5ukLPCPhL: Downloading SMIL data
[ThePlatform] RNL5ukLPCPhL: Downloading m3u8 information
[ThePlatform] RNL5ukLPCPhL: Downloading JSON metadata
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on u'https://tvesyfy-vh.akamaihd.net/i/prod/video/161/931/170831_3577425_33_anvver_7_,40,25,18,12,7,4,2,00.mp4.csmil/index_0_av.m3u8?null=0&id=AgDCJG9OFzI1pJSl7F1jR%2fQPeSElxisxui4QOdO3FQ+bw9xLc9yuGPEYAQd4Vrphpcv%2fcsydQ0U5wA%3d%3d&hdntl=exp=1575876372~acl=%2fi%2fprod%2fvideo%2f161%2f931%2f170831_3577425_33_anvver_7_*~data=hdntl~hmac=ada211b066c5fb12ab15f4626e705a30cbf67c787c1dda6210cd9730978dcd54'
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 260
[download] Destination: 33-RNL5ukLPCPhL.mp4
[download]   0.0% of ~2.66GiB at 631.83KiB/s ETA 02:23:56
@stvrly
Copy link
Author

@stvrly stvrly commented Dec 8, 2019

You're right. Googling that X version revealed https://stackoverflow.com/questions/48155294/what-is-pycryptodomex-and-how-does-it-differ-from-pycryptodome. I removed python-cryptodome (which is the standalone version). I installed python-crypto instead, which contains the supported library. Thanks for the nudge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.