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

[CtsNews] Fix YouTube embed video url regex and test cases #21678

Merged
merged 1 commit into from
Jul 15, 2019

Conversation

chien-yu
Copy link
Contributor

@chien-yu chien-yu commented Jul 7, 2019

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

Fixed the YouTube embedded video URL regex pattern, somehow it was missing the "https" part in the beginning. I have tested this extractor's 3 unit test cases and updated the other 2 description.

@@ -63,7 +63,8 @@ def _real_extract(self, url):
else:
self.to_screen('Not CTSPlayer video, trying Youtube...')
youtube_url = self._search_regex(
r'src="(//www\.youtube\.com/embed/[^"]+)"', page, 'youtube url')
r'src="(https?://www.youtube.com/embed/[^"]+)"', page, 'youtube 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. _extract_urls of youtube extractor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done.

@@ -63,7 +63,8 @@ def _real_extract(self, url):
else:
self.to_screen('Not CTSPlayer video, trying Youtube...')
youtube_url = self._search_regex(
r'src="(//www\.youtube\.com/embed/[^"]+)"', page, 'youtube url')
r'src="(https?://www.youtube.com/embed/[^"]+)"', page, 'youtube url')
print(youtube_url)
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 garbage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@chien-yu chien-yu force-pushed the bugfix/IE_CtsNews-youtube-embed branch from f834ebe to 281db3a Compare July 14, 2019 19:17
@dstftw dstftw merged commit 7d4dd3e into ytdl-org:master Jul 15, 2019
Lamieur referenced this pull request in Lamieur/youtube-dl Aug 3, 2019
meunierd referenced this pull request in meunierd/youtube-dl Feb 13, 2020
Lamieur referenced this pull request in Lamieur/youtube-dl Apr 20, 2020
Lamieur referenced this pull request in Lamieur/youtube-dl Apr 20, 2020
pareronia referenced this pull request in pareronia/youtube-dl Jun 22, 2020
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