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

[OnePieceTube] Add new extractor #12305

Closed
wants to merge 1 commit into from
Closed

[OnePieceTube] Add new extractor #12305

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 28, 2017

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

An extractor for the site onepiece-tube.com

# coding: utf-8
from __future__ import unicode_literals

import lxml.html
Copy link
Collaborator

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')
Copy link
Collaborator

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'):
Copy link
Collaborator

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)
Copy link
Collaborator

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')
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove all pointless comments.

@yan12125
Copy link
Collaborator

yan12125 commented Feb 28, 2017

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?

[1] https://en.wikipedia.org/wiki/One_Piece

@ghost ghost closed this Feb 28, 2017
@ghost ghost deleted the opinator branch February 28, 2017 19:52
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants