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
132.02k stars 10.01k forks source link

Hi Appreciate if you help download videos from the site -https://olympus.greatlearning.in/courses/4971/pages/unstructured-data-course-introduction?module_item_id=250532 #22868

Open bharathkreddy opened 4 years ago

bharathkreddy commented 4 years ago

Checklist

Example URLs

Description

Hi i am trying to download videos for a course to watch these offline. the course site is : https://olympus.greatlearning.in/courses/4971/pages/unstructured-data-course-introduction?module_item_id=250532 userid : reddybharath.k@gmail.com password - Bharath@1

The video is a blob and streams as multiple .ts files generated from a java script. Is this possible using this software ?

skyme5 commented 4 years ago

Unfortunately the videos are encrypted with AES-128. When attempting to download using FFMPEG it gives 'Invalid data found when processing input' error.

remitamine commented 4 years ago

for now, you can use this command to download the HLS manifest captured using the Browser Developer tools. youtube-dl --hls-prefer-native --cookies COOKIE_FILE --referer https://olympus1.greatlearning.in/ HLS_URL

youtube-dl --hls-prefer-native --cookies ~/Downloads/cookies.txt --referer https://olympus1.greatlearning.in/ 'https://dbq3da34mdptq.cloudfront.net/HLS/production/a73a2397-10ee-4452-98c7-392d53704c25.m3u8?Expires=1572202836&Signature=SIGNATURE&Key-Pair-Id=APKAIT7ACLZQMDFJXCBQ'
[generic] a73a2397-10ee-4452-98c7-392d53704c25: Requesting header
[generic] a73a2397-10ee-4452-98c7-392d53704c25: Downloading m3u8 information
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 28
[download] Destination: a73a2397-10ee-4452-98c7-392d53704c25-a73a2397-10ee-4452-98c7-392d53704c25.mp4
[download] 100% of 17.36MiB in 00:50
[ffmpeg] Fixing malformed AAC bitstream in "a73a2397-10ee-4452-98c7-392d53704c25-a73a2397-10ee-4452-98c7-392d53704c25.mp4"
skyme5 commented 4 years ago

@remitamine when using the above mentioned method the same error exist. As shown in the error log below.

youtube-dl --hls-prefer-native --cookies COOKIE_FILE --referer https://olympus1.greatlearning.in/ https://dbq3da34mdptq.cloudfront.net/HLS/production/output-dd150f4d-b906-484c-b9f7-1e77c8c3dd42-540p.m3u8
[generic] output-dd150f4d-b906-484c-b9f7-1e77c8c3dd42-540p: Requesting header
[generic] output-dd150f4d-b906-484c-b9f7-1e77c8c3dd42-540p: Downloading m3u8 information
[hlsnative] Downloading m3u8 manifest
WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg
[download] Destination: output-dd150f4d-b906-484c-b9f7-1e77c8c3dd42-540p-output-dd150f4d-b906-484c-b9f7-1e77c8c3dd42-540p.mp4
ffmpeg version git-2019-10-26-1054752 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20191010
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --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-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 35.101 / 56. 35.101
  libavcodec     58. 60.100 / 58. 60.100
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 65.100 /  7. 65.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[hls @ 0000000000131fc0] Skip ('#EXT-X-VERSION:3')
[hls @ 0000000000131fc0] Skip ('#EXT-X-ALLOW-CACHE:YES')
[hls @ 0000000000131fc0] Opening 'https://olympus1.greatlearning.in/api/v1/hls_videos/token/f0a3b041-d60c-4659-8c80-f12192192e35' for reading
[hls @ 0000000000131fc0] Opening 'crypto+https://dbq3da34mdptq.cloudfront.net/HLS/production/output-dd150f4d-b906-484c-b9f7-1e77c8c3dd42-540p00000.ts' for reading
[hls @ 0000000000131fc0] Opening 'crypto+https://dbq3da34mdptq.cloudfront.net/HLS/production/output-dd150f4d-b906-484c-b9f7-1e77c8c3dd42-540p00001.ts' for reading
[hls @ 0000000000131fc0] Error when loading first segment 'https://dbq3da34mdptq.cloudfront.net/HLS/production/output-dd150f4d-b906-484c-b9f7-1e77c8c3dd42-540p00000.ts'
https://dbq3da34mdptq.cloudfront.net/HLS/production/output-dd150f4d-b906-484c-b9f7-1e77c8c3dd42-540p.m3u8: Invalid data found when processing input

ERROR: ffmpeg exited with code 1
remitamine commented 4 years ago

the URL your using is missing the required query string like ?Expires=1572202836&Signature=SIGNATURE&Key-Pair-Id=APKAIT7ACLZQMDFJXCBQ(it contain a longer signature), and also make sure that your using authenticated cookies.

skyme5 commented 4 years ago

Still gives the same error. I think there might be another key needed for the decryption.

remitamine commented 4 years ago

obviously you're doing something wrong or didn't use the URL quickly(before the URL expires), and as I shown in the output above the video has been downloaded and it's playable.