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

[pear] Add new extractor #13031

Closed
wants to merge 2 commits into from
Closed

[pear] Add new extractor #13031

wants to merge 2 commits into from

Conversation

troywith77
Copy link
Contributor

@troywith77 troywith77 commented May 9, 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

Added a new extractor for http://www.pearvideo.com, which is a popular short video website in China.

@dstftw
Copy link
Collaborator

dstftw commented May 9, 2017

Check code with flake8 an squash commits.


title = self._html_search_regex(r'<h1[^>]+class="video-tt">(.+)</h1>', webpage, 'title')
description = self._html_search_regex(r'<div[^>]+class="summary"[^>]*>([^<]+)<', webpage, 'description', fatal=False)
hdUrl = self._html_search_regex(r'hdUrl="(.*?)"', webpage, 'url')
Copy link
Collaborator

Choose a reason for hiding this comment

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

All formats should be extracted.

video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)

title = self._html_search_regex(r'<h1[^>]+class="video-tt">(.+)</h1>', webpage, 'title')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should not be greedy.

'ext': 'mp4',
'title': '小浣熊在主人家玻璃上滚石头:没砸',
'description': '小浣熊找到一个小石头,仿佛发现了一个宝贝。它不停地用石头按在玻璃上,滚来滚去,吸引主人注意。',
'url': 'http://video.pearvideo.com/mp4/short/20170508/cont-1076290-10438018-hd.mp4'
Copy link
Collaborator

Choose a reason for hiding this comment

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

No.

@dstftw
Copy link
Collaborator

dstftw commented Sep 23, 2017

Do you want to be credited as one of the authors of youtube-dl? If so under what name?

@troywith77
Copy link
Contributor Author

@dstftw It's my pleasure, thanks for your kindness~ My name is Tang Rui.

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.

None yet

2 participants