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

[BritishCouncil] Add new extractor #25424

Closed
wants to merge 5 commits into from
Closed

Conversation

jgilf
Copy link

@jgilf jgilf commented May 27, 2020

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

New extractor for britishcouncil.org videos as requested by #25368

As the website uses Viddler as a provider, I've added a base Viddler IE to limit code repetition.

All tests pass and code has been check with flake8.

@jgilf jgilf changed the title Britishcouncil [BritishCouncil] Add new extractor May 27, 2020
@dstftw
Copy link
Collaborator

dstftw commented May 27, 2020

You must delegate to viddler extractor not inherit from it.
This also must go into generic extractor since it's a generic embed.

@jgilf
Copy link
Author

jgilf commented May 27, 2020

Right, I understand. Sorry, didn't quite understand the convention.
I have updated my code to fix these issues.
Let me know if there is anything further I need to amend. Thanks!

@dstftw
Copy link
Collaborator

dstftw commented May 27, 2020

  1. Read coding conventions.
  2. Add support for all kinds of embeds.

@jgilf
Copy link
Author

jgilf commented May 28, 2020

Thanks, I've updated my regex to meet coding conventions.

All three embed options in your link will now be caught by the generic extractor. Let me know any additional touch ups are required. Thanks!

webpage)
if mobj is not None:
return ViddlerIE._build_url_result(mobj.group('id'))

Copy link
Collaborator

Choose a reason for hiding this comment

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

Move embed extraction code to ViddlerIE._extract_urls.

Comment on lines +77 to +84
@staticmethod
def _url_for_id(id):
return 'http://www.viddler.com/v/%s' % id

@classmethod
def _build_url_result(cls, id):
return cls.url_result(cls._url_for_id(id),
ie=cls.ie_key())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Inline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defunct PR source branch is not accessible do-not-merge invalid
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants