chrippa / livestreamer

Command-line utility that extracts streams from various services and pipes them into a video player of choice. No longer maintained, use streamlink or youtube-dl instead.
http://livestreamer.io/
BSD 2-Clause "Simplified" License
3.88k stars 580 forks source link

tvplayer.com error (cannot resolve 'live.cdn.tvplayer.com') #1358

Open alza-bitz opened 8 years ago

alza-bitz commented 8 years ago

When I try to open a tvplayer.com url:

[me@myhost ~]$ livestreamer http://tvplayer.com/watch/channel4

I get the following error:

[cli][info] Found matching plugin tvplayer for URL http://tvplayer.com/watch/channel4
error: Unable to open URL: 
http://live.cdn.tvplayer.com//playlist.m3u8?e=1466106379&h=1e29e0e4bc59e1eb27fe947b6e9a2dcd
(HTTPConnectionPool(host='live.cdn.tvplayer.com', port=80): 
Max retries exceeded with url: //playlist.m3u8?e=1466106379&h=1e29e0e4bc59e1eb27fe947b6e9a2dcd 
(Caused by NewConnectionError
('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f08a1c206a0>: 
Failed to establish a new connection: [Errno -5] No address associated with hostname',)))`

Is this a tvplayer.com problem, or a livestreamer problem?

Observed on Fedora 23, with livestreamer installed from dnf:

[me@myhost ~]$ livestreamer --version-check
[cli][info] Your Livestreamer version (1.12.2) is up to date!

[me@myhost ~]$ rpm -q livestreamer
livestreamer-1.12.2-3.fc23.noarch
ghost commented 8 years ago

Channel 4 stream uses a different HLS playlist (at least on their website).

http://live.tvplayer.com/channel4/live.m3u8
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=214000
http://live.tvplayer.com/channel4/1/prog_index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=564000
http://live.tvplayer.com/channel4/2/prog_index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1064000
http://live.tvplayer.com/channel4/3/prog_index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1864000
http://live.tvplayer.com/channel4/4/prog_index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2564000
http://live.tvplayer.com/channel4/5/prog_index.m3u8
livestreamer --http-header "Cookie=CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cDovL2xpdmUudHZwbGF5ZXIuY29tLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE0NjYyMjk3Njh9fX1dfQ__; CloudFront-Signature=PWpuCPc49HF6wjG6sWmDqliRfMuNyDv9RYkaurnrYxp2UOLKMpSAECc-6jZ7W8XiudGxcLbQuj0jiLRtQ-fPcBuOPK8VBoz3gcv8t8hydckz85y2xHGjmxI8nTSTa1I~aC0QwolHanG9kXripzt1LfALacJB44Zd5O~N~PIDL7v1SzfXJHjebUl7fAA0IVT3tQenbiCMCJbydrhr6zuhgNuEuIf4V9HIQOheMN-JG7tX7E3Z-08De3IyAoQEw3zUXgyd4w2~d8k-4vS-NSSNNkOG7YQXuGIhRui1oSiObfEei7-kQyajGSdBzeuldwXB2f3Y3nOWWLZnuzY86Ga4vw__; CloudFront-Key-Pair-Id=APKAJGWDVCU5SXAPJELQ" "hlsvariant://live.tvplayer.com/channel4/live.m3u8" best
[cli][info] Found matching plugin stream for URL hlsvariant://live.tvplayer.com/channel4/live.m3u8
[cli][info] Available streams: 214k (worst), 564k, 1064k, 1864k, 2564k (best)
[cli][info] Opening stream: 2564k (hls)
Video: MPEG4 Video (H264) 1024x576 25fps [V: h264 main L3.1, yuv420p, 1024x576]
Audio: AAC 44100Hz stereo 62kbps [A: aac lc, 44100 Hz, stereo, 62 kb/s]
alza-bitz commented 8 years ago

Thanks, that command line worked for me :+1:

How were you able to determine the correct stream url (http://live.tvplayer.com/channel4/live.m3u8), and also the required cookie names/values manually? Shouldn't the plugin be able to determine these details from the top-level page url?

Thanks again.

ghost commented 8 years ago

There are various ways to obtain all necessary parameters. For example every modern web browser has inbuilt developer tools. Personally I use the Firefox Network Monitor. Cookie parameters are expired now (403 Client Error: Forbidden), so you will have to generate your own values.

TRPB commented 8 years ago

is there any way to get the plugin connect to the website and auto-generate all the relevant HTTP headers?