Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rtve] Add support for audio only #29023

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kebianizao
Copy link

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:

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:

  • 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
  • New extractor
  • New feature

Description of your pull request and other information

This adds support to audio only urls to the rtve extractor. So far this extractor did not support urls like Audio only episode . With this extension such audio only url is supported.

The class supporting the above mentioned url includes a test case which runs successfully here.

@dstftw
Copy link
Collaborator

dstftw commented May 16, 2021

Read coding conventions.

@sukiletxe
Copy link

Also, with the new redesign this no longer works for downloading. Now you need to do the same thing that the video downloader does (i. e. get the formats from the png using _decrypt_url, replacing videos with audios in the png url).

@kebianizao
Copy link
Author

Thanks for the comments, Sukil. I've addressed somehow the problems of the new urls (just pushed), but I'll look further into your suggestions. Regards,

@sukiletxe
Copy link

Weird, seems like with your test it works, but with other radio programs it doesn't and you have to take the _decrypt_url route. With these you get a generic url in filepath.

@kebianizao
Copy link
Author

kebianizao commented Oct 4, 2021

Thanks for your comment. I guess it is possible to improve something or fetch more information about the media, but I have tried some other urls and they work:

$ python3 -m youtube_dl -g https://www.rtve.es/play/audios/a-hombros-de-gigantes/palabra-ingeniero-codigos-informaticos-27-04-21/5889192/
https://mediavod-lvlt.rtve.es/resources/TE_SAHOMB/mp3/4/3/1619511337934.mp3
$ python3 -m youtube_dl -g https://www.rtve.es/play/audios/las-mananas-de-rne-con-pepa-fernandez/asier-etxeandia-actua-en-la-gala-de-los-premios-max/6124417/
https://mediavod-lvlt.rtve.es/resources/TE_SMAPPDE/mp3/3/7/1633339436173.mp3
$ python3 -m youtube_dl -g https://www.rtve.es/play/audios/atlantic-express/rafael-guastavino-arquitecto-novelesco-deslumbrante/6120193/
https://mediavod-lvlt.rtve.es/resources/TE_R800011/mp3/4/5/1633075321954.mp3
$ python3 -m youtube_dl -g https://www.rtve.es/play/audios/radiogramas/cinicos-10-05-21/5898967/
https://mediavod-lvlt.rtve.es/resources/TE_SRADIOG/mp3/5/2/1620637788325.mp3

Could you let me know of any that it is not working so I can test proof it myself?
Thanks,

@kebianizao
Copy link
Author

I've taken a look at those examples. The problem is that the json provided by the rtve api service https://www.rtve.es/api/audios/<id>.json does not contain the final media url in some cases, for instance, in the json section page.items[0].qualities[0]

  • Working example: "filePath": "https://mediavod-lvlt.rtve.es/resources/TE_SAHOMB/mp3/4/3/1619511337934.mp3"
  • Not working example: "filePath": "http://ztnr.rtve.es/ztnr/res/_PROVIDER_/audio/high/_TOKEN_"
    I'll try to find out another method for retrieving the right download url.

@sukiletxe
Copy link

I've already explained the correct method. Look at how the video extractor does it, and do the same thing, changing videos to audios when getting the thumnail url to pass it to _decrypt_url.
I don't know which formats are there going to be in all audio-only streams, but the in my testing there has been mp3 only.

@kebianizao
Copy link
Author

Sorry not considering you advice, I now see png decrypt is required (by the way, extracting info like this is insane). I have pushed a first approach. I now need to refactor it more properly.

@kebianizao
Copy link
Author

FYI I've moved to yt-dlp. I moved the PR to yt-dlp/yt-dlp#1657 Feel free to follow-up there.

pukkandan pushed a commit to yt-dlp/yt-dlp that referenced this pull request Dec 21, 2021
Original PR: ytdl-org/youtube-dl#29023
Authored by: kebianizao
@kebianizao
Copy link
Author

Closing as PR is already merged.

@kebianizao kebianizao closed this Aug 15, 2022
@dirkf
Copy link
Contributor

dirkf commented Aug 15, 2022

I'd rather keep it open to remind us to implement the functionality here, but probably by pulling the dlp code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants