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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[extractor/pbskids] Add support for pbskids.org videos #7602

Merged
merged 10 commits into from Jul 31, 2023

Conversation

snixon
Copy link
Contributor

@snixon snixon commented Jul 15, 2023

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

This PR adds support for videos on the pbskids.org site. I added it as a second extractor to the existing extractor/pbs.py, but if that's not appropriate I can split it out to its own file, it doesn't share any code with the existing extractor.

I think I found all the proper convenience methods, passes flake8

Fixes #2440

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 ec225c9

Summary

馃殮馃馃搳

Added a new extractor for PBS Kids videos. The PBSKidsIE class in pbs.py handles the JSON data from the PBS Kids website and extracts the video formats and metadata. The class is registered in _extractors.py as a supported extractor.

To support PBS Kids videos
We imported json and traverse_obj modules
And created a new class PBSKidsIE
That parses the data and extracts the info we need
To download and enjoy the shows

Walkthrough

  • Add a new extractor class PBSKidsIE to handle PBS Kids videos (link)
  • Import json module and traverse_obj function to parse and access JSON data embedded in the webpage (link, link)
  • Register PBSKidsIE as a supported extractor in _extractors.py (link)
  • Define the URL pattern, test cases, and extraction method for PBSKidsIE (link)
  • Extract various metadata fields from the JSON data, such as title, description, duration, series, categories, upload_date, etc. (link)
  • Extract the m3u8 playlist URL and call _extract_m3u8_formats_and_subtitles to get the available formats and subtitles (link)
  • Return a dictionary with the extracted information (link)

@snixon snixon changed the title [extractors/pbskids] Add support for pbskids.org videos [extractor/pbskids] Add support for pbskids.org videos Jul 15, 2023
yt_dlp/extractor/pbs.py Outdated Show resolved Hide resolved
yt_dlp/extractor/pbs.py Outdated Show resolved Hide resolved
yt_dlp/extractor/pbs.py Outdated Show resolved Hide resolved
yt_dlp/extractor/pbs.py Outdated Show resolved Hide resolved
@bashonly bashonly added site-request Request to support a new website pending-fixes PR has had changes requested labels Jul 16, 2023
snixon and others added 4 commits July 15, 2023 23:29
Ahh thank you, I was wondering if there was a better way to trawl out that json

Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
@snixon
Copy link
Contributor Author

snixon commented Jul 16, 2023

Thanks for the review!

@pukkandan pukkandan removed the pending-fixes PR has had changes requested label Jul 16, 2023
yt_dlp/extractor/pbs.py Outdated Show resolved Hide resolved
yt_dlp/extractor/pbs.py Outdated Show resolved Hide resolved
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
@snixon snixon requested a review from bashonly July 18, 2023 16:48
yt_dlp/extractor/pbs.py Outdated Show resolved Hide resolved
@snixon snixon requested a review from pukkandan July 18, 2023 17:59
@snixon
Copy link
Contributor Author

snixon commented Jul 31, 2023

@pukkandan Could you take a look? I've got the changes in place. Would you prefer a cleaner PR with just a single commit?

@Grub4K
Copy link
Member

Grub4K commented Jul 31, 2023

The PR will be squashed upon merge, resulting in a single commit anyways. Do not worry about commit messages and amount of commits

@pukkandan pukkandan merged commit 6d6081d into yt-dlp:master Jul 31, 2023
13 checks passed
@snixon snixon deleted the pbskids branch July 31, 2023 17:24
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-request Request to support a new website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PBS]PBSKids.org
5 participants