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

Hotfix for radiko.jp #6159

Merged
merged 6 commits into from
Feb 11, 2023
Merged

Hotfix for radiko.jp #6159

merged 6 commits into from
Feb 11, 2023

Conversation

road-master
Copy link
Contributor

@road-master road-master commented Feb 5, 2023

Description of your pull request and other information

Summary of issue:

Can't download radiko.jp Time Free.
See also: #6090

Cause

The update of radiko.jp.
Some of supplied hosts are not supported by FFmpeg.
Note that the version of FFmpeg is not related with this issue.

Summary of update

Filter supplied hosts before check details of them.

  • Condition is little complex.
    • To simplify, stop to use is_onair and implement method like is_unsupported_host() into class: RadikoIE and RadikoRadioIE instead and move condition into its method.
      • However, this pull request leave it since this is hotfix.

Confirmed tests

  • Download radiko.jp Live
  • Download radiko.jp Time Free
  • Play downloaded AAC file
  • Check format of donwloaded AAC file by MediaInfo
  • Check which supplied host is available or not

Investigation result

  • Live has dedicated host
  • The host: radiko.jp is the firstest host to download
    • However, some of programs doesn't support this host, it requires one more scheme to prioritize radiko.jp
      • So that this pull request doesn't do anything for this.
  • The difference between downloaded AAC files from each host is only stream size.
  • When FFmpeg connect to c-radiko.smartstream.ne.jp, FFmpeg forcibly connects not Time Free but Live.
Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp 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?

Co-authored-by: Lesmiscore <nao20010128@gmail.com>
@@ -92,9 +109,11 @@ def _extract_formats(self, video_id, station, is_onair, ft, cursor, auth_token,
formats = []
found = set()
for url_tag in m3u8_urls:
pcu = url_tag.find('playlist_create_url')
pcu = url_tag.find('playlist_create_url').text
if is_onair and not pcu.startswith(self._HOSTS_FOR_LIVE) or (not is_onair and (pcu.startswith(self._HOSTS_FOR_TIME_FREE_FFMPEG_UNSUPPORTED) or pcu.startswith(self._HOSTS_FOR_LIVE)))):
Copy link
Member

@pukkandan pukkandan Feb 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this can be simplified to:

Suggested change
if is_onair and not pcu.startswith(self._HOSTS_FOR_LIVE) or (not is_onair and (pcu.startswith(self._HOSTS_FOR_TIME_FREE_FFMPEG_UNSUPPORTED) or pcu.startswith(self._HOSTS_FOR_LIVE)))):
if (on_air ^ pcu.startswith(self._HOSTS_FOR_LIVE)) or (
not is_onair and pcu.startswith(self._HOSTS_FOR_TIME_FREE_FFMPEG_UNSUPPORTED)):

yt_dlp/extractor/radiko.py Outdated Show resolved Hide resolved
yt_dlp/extractor/radiko.py Outdated Show resolved Hide resolved
@pukkandan pukkandan added site-bug Issue with a specific website pending-fixes PR has had changes requested labels Feb 8, 2023
@Lesmiscore Lesmiscore removed the pending-fixes PR has had changes requested label Feb 11, 2023
@Lesmiscore Lesmiscore merged commit 203a06f into yt-dlp:master Feb 11, 2023
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants