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.28k stars 10.03k forks source link

Request: House and Senate Livestreams #27911

Open NoSoyJamie opened 3 years ago

NoSoyJamie commented 3 years ago

Hey Yall

Looking to see if it's possible to implement support for the livestreams for the house and senate.

Poking around on the sites I was able to find two URLs that open the livestreams:

https://floor.senate.gov/livestreams/6/player https://live.house.gov/

The senate URL loads a tab with only the stream player, I am able to drop this link onto mpv and it plays almost flawlessly, attempting to feed this URL into youtube-dl returns the following error (from ffmpeg it seems):

C:\Users\USERNAME\Desktop\mpv>youtube-dl.exe https://floor.senate.gov/livestreams/6/player
[generic] player: Requesting header
WARNING: Falling back on generic information extractor.
[generic] player: Downloading webpage
[generic] player: Extracting information
[generic] player: Downloading m3u8 information
[download] Downloading playlist: ussenate02enc - Live Stream
[generic] playlist ussenate02enc - Live Stream: Collected 1 video ids (downloading 1 of them)
[download] Downloading video 1 of 1
[download] Destination: ussenate02enc - Live Stream-player.mp4
ffmpeg version N-100554-g89c9c42c5b Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 9.3-win32 (GCC) 20200320
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
  libavutil      56. 63.100 / 56. 63.100
  libavcodec     58.115.102 / 58.115.102
  libavformat    58. 65.101 / 58. 65.101
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 95.100 /  7. 95.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[hls @ 000001e294a84c80] Skip ('#EXT-X-VERSION:3')
[hls @ 000001e294a84c80] Opening 'http://granicusliveus1-a.akamaihd.net/senate/G0988_006/media-udooti5kf_1290.ts' for reading
[hls @ 000001e294a84c80] Opening 'http://granicusliveus1-a.akamaihd.net/senate/G0988_006/media-udooti5kf_1291.ts' for reading
Input #0, hls, from 'http://granicusliveus1-a.akamaihd.net/senate/G0988_006/chunklist.m3u8':
  Duration: N/A, start: 12891.776689, bitrate: N/A
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p(tv), 640x360 [SAR 1:1 DAR 16:9], 59.94 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:2: Audio: mp3 ([4][0][0][0] / 0x0004), 44100 Hz, stereo, fltp, 96 kb/s
    Metadata:
      variant_bitrate : 0
[aac_adtstoasc @ 000001e296d2a1c0] Codec 'mp3' (86017) is not supported by the bitstream filter 'aac_adtstoasc'. Supported codecs are: aac (86018)
Error initializing bitstream filter: aac_adtstoasc
Error initializing output stream 0:1 --
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
    Last message repeated 1 times

ERROR: ffmpeg exited with code 1

C:\Users\USERNAME\Desktop\mpv>

As for the house livestream, I cant really find a player URL that can be fed into mpv or youtube-dl. Wondering if yall can provide some wisdom here.

Unknown6656 commented 3 years ago

Your first URL is invalid. The correct URL is https://granicusliveus1-a.akamaihd.net/senate/G0988_006/chunklist.m3u8 This can be tested in VLC: image

sigaloid commented 3 years ago

Streamlink would be better for this task afaik.