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.41k stars 10.04k forks source link

Support for Talk TV #30899

Open user182015 opened 2 years ago

user182015 commented 2 years ago

Checklist

Example URLs

Description

New UK TV Channel, Talk TV (talk.tv) has on demand shows.

It is an unsupported URL. Any way we could fix this?

Thanks!

dirkf commented 2 years ago

In the page:

<div
    id="player"
    data-env="production"
    data-id="nagOiJbuFEADH5v"
    data-type="vod"
    data-key="7Sa4Ec3Gz8Xz5Ms1Ff8Mo0Ds1Zn3Zg"
    data-uvid="45196240"
    data-token="1ae0cf1ac3cbaf1a8ae618389f68d6d3"
    data-expiry="1650968592"
    data-poster="https://thumbnails.simplestreamcdn.com/talktv/ondemand/45196240.jpg?width=700&amp;"
    data-position="0"
    data-country="GB"
...

The stream API URL:

https://v2-streams-elb.simplestreamcdn.com/api/show/stream/45196240?key=7Sa4Ec3Gz8Xz5Ms1Ff8Mo0Ds1Zn3Zg&platform=firefox&cc=GB

So:

https://v2-streams-elb.simplestreamcdn.com/api/show/stream/{uvid}?key={key}&platform=firefox&cc={country}

That gets the m3u8 manifest that can be pulled by yt-dl.

In case the domain name might vary, this URL

https://mm-v2.simplestream.com/ssmp/api.php?id=nagOiJbuFEADH5v&env=production
==
https://mm-v2.simplestream.com/ssmp/api.php?id={id}&env={env}

gets JSON whose .response contains "api_hostname": "https://v2-streams-elb.simplestreamcdn.com"

Basically, someone needs to create an extractor that does these things.

dirkf commented 2 years ago

The .../vod/... URL is obsolete. I can't see a way of getting that URL format from the website now.

dirkf commented 2 years ago

Feel free to test the extractor in PR #30903.