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
131.89k stars 10k forks source link

[TubiTv] Extractor overhaul #32945

Open dirkf opened 1 week ago

dirkf commented 1 week ago
Boilerplate: own/yt-dlp code, bug fix/improvement ## Please follow the guide below - You will be asked some questions, please read them **carefully** and answer honestly - Put an `x` into all the boxes [ ] relevant to your *pull request* (like that [x]) - Use *Preview* tab to see how your *pull request* will actually look like --- ### Before submitting a *pull request* make sure you have: - [x] [Searched](https://github.com/ytdl-org/youtube-dl/search?q=is%3Apr&type=Issues) the bugtracker for similar pull requests - [x] Read [adding new extractor tutorial](https://github.com/ytdl-org/youtube-dl#adding-support-for-a-new-site) - [x] Read [youtube-dl coding conventions](https://github.com/ytdl-org/youtube-dl#youtube-dl-coding-conventions) and adjusted the code to meet them - [x] Covered the code with tests (note that PRs without tests will be REJECTED) - [x] Checked the code with [flake8](https://pypi.python.org/pypi/flake8) ### In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under [Unlicense](http://unlicense.org/). Check one of the following options: - [x] I am the original author of this code and I am willing to release it under [Unlicense](http://unlicense.org/), except for code from yt-dlp for which this or the below has already been asserted. - [ ] I am not the original author of this code but it is in public domain or released under [Unlicense](http://unlicense.org/) (provide reliable evidence) ### What is the purpose of your *pull request*? - [x] Bug fix - [x] Improvement - [ ] New extractor - [ ] New feature ---

Description of your pull request and other information

This PR updates the extractor for tubitv.com and adds a series/season extractor.

The PR includes these features back-ported from yt-dlp:

Breaking change: TubiTvIE no longer recognises the URL scheme tubitv:{id}; instead, use https://tubitv.com/tv-shows/{id}/.

Rationale for modifying TubiTvShowIE extraction tactic is here.

3052 commented 5 days ago

I believe most or all Tubi stuff is DRM:

17:37:00 INFO GET URL="https://akamai2.tubi.video/88b7ef51-54f9-48fe-8943-634b31fb0f44/fgj9amb521.mpd?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjZG5fcHJlZml4IjoiaHR0cHM6Ly9ha2FtYWkyLnR1YmkudmlkZW8iLCJleHAiOjE3MjkwMDQ0MDAsIm1lZGlhX3NpZyI6ODM4MTIzOTB9.wJ3PsGRl7folpvvi-oOBo9CL1K1LIzRJEc8pr75lvwQ"
17:37:00 INFO GET URL=https://akamai2.tubi.video/88b7ef51-54f9-48fe-8943-634b31fb0f44/mvxj2g5x.mp4
17:37:01 INFO POST URL="https://license.adrise.tv/challenge?platform=android&type=widevine&external_id=438575BA9647B98CF82164CF3E4BC1A2&drm_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhbmFsb2dfb3V0IjoiY2dtc19yZXF1aXJlZCIsImV4cCI6MTcyODkxODAwMCwiaGRjcCI6InYxIiwicHJfc2VjdXJpdHlfbGV2ZWwiOjIwMDAsInd2X3NlY3VyaXR5X2xldmVsIjoxfQ.hrFNoerXHtlutTlAcNO8TmV76_T44PtyQMP3o__V8H4"
17:37:01 INFO CDM PSSH=EhBDyrHXYe5CxLbpnTq8PM9ESOPclZsG key="+b3knU8vB5kYz1NhNAAQSw=="
17:37:01 INFO GET URL=https://akamai2.tubi.video/88b7ef51-54f9-48fe-8943-634b31fb0f44/mvxj2g5x.mp4
17:37:02 INFO 0.54 % size="8.39 megabyte" rate="8.37 megabyte/s"
dirkf commented 5 days ago

Probably so, but the test videos here are examples of unprotected content.

3052 commented 5 days ago

huh actually maybe I am wrong - this one uses DRM

https://tubitv.com/movies/100003987/casino

but if you disable Widevine it still works. OK never mind. this one use DRM:

https://tubitv.com/movies/679215/the-three-stooges-meet-hercules

and if you disable Widevine it wont play

dirkf commented 5 days ago

Maybe 100003987 has some, perhaps higher res, formats with DRM. The extractor is meant to ignore those if playable formats are found.

Pls feel free to test this PR against it (requires US IP, or Content Unavailable).

Ashish0804 commented 3 days ago

Tubi was in process of adding DRM when i was working on the extractor. dlp has checks to auto ignore drm material and hence we didn't bother much to explicitly handle it.

Might want to check how dl treats drm content. Also tubi has (had) alternative endpoint to provide drm-free in pisspoor quality back then, mainly for TVs. Might want to check if that endpoint is still up.

3052 commented 2 days ago

Also tubi has (had) alternative endpoint to provide drm-free in pisspoor quality back then, mainly for TVs. Might want to check if that endpoint is still up.

Ive checked, its not.