youtube-dl icon indicating copy to clipboard operation
youtube-dl copied to clipboard

[TRT] Add extractor for Turkish state TV/Radio

Open dirkf opened this issue 2 years ago • 1 comments

Boilerplate: own code, new extractor ## Please follow the guide below

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • [x] I am the original author of this code and I am willing to release it under Unlicense
  • [ ] I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • [ ] Bug fix
  • [ ] Improvement
  • [x] New extractor
  • [ ] New feature

Description of your pull request and other information

As requested in #30906, the PR adds support for TRT (Turkish state TV/Radio) at the site https://www.trtizle.com.

Features

  • [x] individual catch-up for TRT shows with URL path /{cat}/{show}/{episode} for cat matching diziler|programlar|belgesel|filmler|cocuk|trtarsiv|engelsiz
  • [x] playlist support for TRT series with URL path /{cat}/{show} as above
  • [x] live stream support for TV channels like /canli/tv/trt-{chan}
  • [x] live stream support for radio channels like `/canli/radyo/{chan}'
  • [ ] login support (meanwhile, use --cookies ...)
  • [ ] personal playlist support (/listem)

Although the episode and series pages are basically identical, yt-dl has no way (at present) of forcing playlist extraction from an episode page since --yes-playlist doesn't mean that. You have to remove the episode part of the URL manually to get the series playlist.

To do:

  • [ ] test radio channels in region (EPG JSON gives 403 in UK)
  • [ ] test TRT-2 in region (manifests give 403 in UK)
  • [ ] test TRT-*Spor in region (manifests give 403 in UK)
  • [ ] add tests for cats trtarsiv, engelsiz
  • [ ] add tests for live radio.

To improve extraction, the common routines that process application/ld+json data are enhanced:

  • series name is extracted from data types such as TVSeries
  • None values for certain fields no longer overwrite previously extracted values.

Resolves #30906.

dirkf avatar May 06 '22 10:05 dirkf

@dirkf a very late reply, but I've ran the testcases and it seems to work just fine.

ahmetlii avatar Nov 12 '22 14:11 ahmetlii