-
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
[CtsNews] Fix YouTube embed video url regex and test cases #21678
[CtsNews] Fix YouTube embed video url regex and test cases #21678
Conversation
youtube_dl/extractor/ctsnews.py
Outdated
@@ -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') |
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. _extract_urls of youtube extractor.
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.
Thanks, done.
youtube_dl/extractor/ctsnews.py
Outdated
@@ -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) |
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 garbage.
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.
Removed.
f834ebe
to
281db3a
Compare
This reverts commit 8c5c367.
This reverts commit 8c5c367.
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
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.