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

[scientology] Add new extractor #16184

Closed
wants to merge 1 commit into from
Closed

Conversation

sguan28
Copy link

@sguan28 sguan28 commented Apr 14, 2018

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 scientology.tv for this issue

@sguan28 sguan28 changed the title scientology.py Add new extractor [scientology] Add new extractor Apr 14, 2018
webpage = self._download_webpage(url, video_id)

title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title').strip()
description = self._html_search_regex(r'<meta name="description" content="(.+?)" />', webpage, 'description').strip()
Copy link
Collaborator

Choose a reason for hiding this comment

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

_html_search_meta.

webpage = self._download_webpage(url, video_id)

title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title').strip()
description = self._html_search_regex(r'<meta name="description" content="(.+?)" />', webpage, 'description').strip()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bother to read coding conventions on optional meta fields.


title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title').strip()
description = self._html_search_regex(r'<meta name="description" content="(.+?)" />', webpage, 'description').strip()
description = re.sub("[^a-zA-Z0-9.,_\s-]+", " ", description)
Copy link
Collaborator

Choose a reason for hiding this comment

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

No.


# changing address for extration url
extract_ext = re.search(r'<episode-video>(.*?)</episode-video>', webpage).group(0)
extract_ext = extract_ext.replace('<episode-video>', '').replace('</episode-video>', '')
Copy link
Collaborator

Choose a reason for hiding this comment

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

_search_regex.

# changing address for extration url
extract_ext = re.search(r'<episode-video>(.*?)</episode-video>', webpage).group(0)
extract_ext = extract_ext.replace('<episode-video>', '').replace('</episode-video>', '')
url = url[:url.find('/', 10)] + extract_ext
Copy link
Collaborator

Choose a reason for hiding this comment

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

urljoin.

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 pending-fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants