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

extract nhk world's new stream provider #8249

Merged
merged 7 commits into from Oct 6, 2023

Conversation

garret1317
Copy link
Collaborator

@garret1317 garret1317 commented Sep 30, 2023

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

friendship ended with piksel
now stream.co.jp is my best friend
- nhk, probably

I think it would be a good idea to cache the api url/token - they probably don't change at all
but grub4k said don't do that kind of thing in yt-dlp proper in the discord, so i won't

Fixes #8242

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 all of the following options that apply:

  • 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?

Copilot Summary

🤖 Generated by Copilot at 932e0a0

Summary

🇯🇵📺🛠️

Improve NHK video extraction by using a new method to get and parse stream data. Fix Piksel extractor issue.

Piksel extractor
fails for some NHK videos
new method works well

Walkthrough

  • Add a method to extract stream API url and token from JavaScript file (_get_vod_api, link)
  • Use the new method to download and parse stream information as JSON (_extract_episode_info, link)
  • Extract formats and subtitles from stream URLs using existing method (_extract_m3u8_formats_and_subtitles, link)
  • Replace the use of Piksel extractor with the new approach (_extract_episode_info, link)

friendship ended with piksel
now stream.co.jp is my best friend
- nhk, probably
@bashonly bashonly added the site-bug Issue with a specific website label Sep 30, 2023
@bashonly bashonly self-requested a review September 30, 2023 14:54
yt_dlp/extractor/nhk.py Outdated Show resolved Hide resolved
yt_dlp/extractor/nhk.py Outdated Show resolved Hide resolved
yt_dlp/extractor/nhk.py Show resolved Hide resolved
yt_dlp/extractor/nhk.py Outdated Show resolved Hide resolved
@bashonly bashonly added the pending-fixes PR has had changes requested label Oct 3, 2023
Co-Authored-By: bashonly <bashonly@bashonly.com>
@bashonly
Copy link
Member

bashonly commented Oct 3, 2023

IIRC videos from this site expire rather quickly, but can we extract old pre-9/26 videos from both piksel and the new API endpoint?

@bashonly bashonly removed the pending-fixes PR has had changes requested label Oct 3, 2023
@garret1317
Copy link
Collaborator Author

garret1317 commented Oct 3, 2023

the piksel APIs are gone apparently
chrominance: update: a bunch of the Piksel-related URLs no longer work, so yt-dlp is completely dead for NHK World until that pull request is merged; the actual video URLs still seem to work (ex. https://mz-nhk10.mzpf.webcdn.stream.ne.jp/www60/mz-nhk10/media/mm/flvmedia/5905/m/F/m/mF_mp4file10621179-4046027.mp4?cid=5905&aid=4046027&afid=8564317&assetid=4046027) but I'm not sure if there's any way to get those URLs now that the old video player and API are gone)
cc @chrominance

@bashonly bashonly added the pending-review PR needs a review label Oct 3, 2023
yt_dlp/extractor/nhk.py Outdated Show resolved Hide resolved
garret1317 and others added 3 commits October 6, 2023 00:33
Co-Authored-By: Simon Sawicki <contact@grub4k.xyz>
yt_dlp/extractor/nhk.py Outdated Show resolved Hide resolved
yt_dlp/extractor/nhk.py Outdated Show resolved Hide resolved
yt_dlp/extractor/nhk.py Outdated Show resolved Hide resolved
@Grub4K Grub4K removed the pending-review PR needs a review label Oct 6, 2023
@bashonly bashonly merged commit e831c80 into yt-dlp:master Oct 6, 2023
16 checks passed
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.

NHK World vods posted after September 26th, 2023 are broken
3 participants