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

[watchertv] Add extractor #9748

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

Conversation

McSwindler
Copy link

@McSwindler McSwindler commented Apr 20, 2024

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

Adds extractor for WatcherTV. Requires login credentials with active subscription. Modified dropout extractor to be a little more generic and extended it to make the watcher extractor. They are identical in their site functionality.

Fixes #

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?

@McSwindler
Copy link
Author

McSwindler commented Apr 20, 2024

It's probably better to merge these 2 extractors since they are essentially the same but with different domain names. I'm just not sure how to architect that as this is my first foray into yt-dlp contributions.

I made the dropout extractor a little more generic and then extended it to make the watcher extractor. If this is not the correct way to do this, please point me in the right direction.

@seproDev seproDev added the site-request Request to support a new website label Apr 20, 2024
@pukkandan
Copy link
Member

You are on the right track. But inheriting from concrete IEs commonly cause a lot of issues and so we try not to do that. You can create a DropoutBaseIE and DropoutSeasonBaseIE from which the others can be inherited. _VALID_URL, _TESTS, etc should go in DropoutIE, while all the shared code goes inside the BaseIE

Alternatively, a single IE can be made to handle both _VALID_URLs by grabbing the host name from the input URL.

@pukkandan pukkandan added the pending-fixes PR has had changes requested label Apr 22, 2024
@McSwindler
Copy link
Author

I went with the *BaseIE method and believe I've taken care of everything.

Since different _NETRC_MACHINE values are needed, and it doesn't look like the url is passed through any of the initialize methods, I didn't think it'd be possible to have both in a single extractor. Unless I'm missing something.

yt_dlp/extractor/dropout.py Show resolved Hide resolved
yt_dlp/extractor/dropout.py Outdated Show resolved Hide resolved
@pukkandan pukkandan removed the pending-fixes PR has had changes requested label Apr 24, 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.

None yet

3 participants