-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[OnePieceTube] Add new extractor #12305
Conversation
# coding: utf-8 | ||
from __future__ import unicode_literals | ||
|
||
import lxml.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lxml
is not allowed.
|
||
def _real_extract(self, url): | ||
video_id = self._match_id(url) | ||
webpage = self._download_webpage(url, 'OnePiece-Tube') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second parameter must be video id.
|
||
# Try meta information title | ||
if title is None: | ||
for elem in root.xpath('//meta[@name="title"]/@content'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utils.xpath_*
.
url = self._search_regex(r'file: ["\'](?P<url>https?://[a-zA-Z0-9/\-\.]*?.mp4)["\']', webpage, 'url', group='url') | ||
|
||
# Get Thumbnail | ||
thumbnail = 'http:' + self._search_regex(r'image: ["\'](?P<thumb>//[a-zA-Z0-9/\-\.]*?.jpg)["\']', webpage, 'thumb', group='thumb', default=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'http:' + None = TypeError
webpage = self._download_webpage(embed_url, 'anistream.com') | ||
|
||
# Get real location of file | ||
url = self._search_regex(r'file: ["\'](?P<url>https?://[a-zA-Z0-9/\-\.]*?.mp4)["\']', webpage, 'url', group='url') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sense to use named group when it's the only one.
video_id = self._match_id(url) | ||
webpage = self._download_webpage(url, 'OnePiece-Tube') | ||
|
||
# Compose title information so far |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all pointless comments.
This website seems distributing copyrighted products: https://www.google.com/transparencyreport/removals/copyright/searchdata/domains/?id=onepiece-tube.com By the way, all pages on http://onepiece-tube.com/ are 404 from here Update: the site is back. http://onepiece-tube.com/folge/778 is a copyrighted product of Toei Animation. [1] Did they bought legal copyrights from copyright holders? |
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])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:
What is the purpose of your pull request?
Description of your pull request and other information
An extractor for the site onepiece-tube.com