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

[ESPN] Include additional URL formats (fixes issue #13244) #13549

Merged
merged 6 commits into from
Jul 6, 2017

Conversation

parmjitv
Copy link
Contributor

@parmjitv parmjitv commented Jul 3, 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:

  • [ x] 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?

  • [ x] Bug fix
  • Improvement
  • New extractor
  • New feature

Updated the regex for the [ESPN] extractor to include additional URL formats for videos featured on the site - issue #13244.

Cheers,

Parmjit V.

@@ -10,7 +10,7 @@


class ESPNIE(InfoExtractor):
_VALID_URL = r'https?://(?:espn\.go|(?:www\.)?espn)\.com/video/clip(?:\?.*?\bid=|/_/id/)(?P<id>\d+)'
_VALID_URL = r'https?://(?:(?:(\w+\.)+)?espn\.go|(?:www\.)?espn)\.com/(?:video/clip(?:\?.*?\bid=|/_/id/)|watch/player\?.*?\bid=)(?P<id>\d+)'
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. (\w+\.) is captured for no purpose.
  2. It's probably time to make regex verbose (?x).

},
'expected_warnings': ['Unable to download f4m manifest'],
}, {
'url': 'http://nonredline.sports.espn.go.com/video/clip?id=19744672',
Copy link
Collaborator

Choose a reason for hiding this comment

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

only_matching.

},
'expected_warnings': ['Unable to download f4m manifest'],
}, {
'url': 'https://cdn.espn.go.com/video/clip/_/id/19771774',
Copy link
Collaborator

Choose a reason for hiding this comment

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

only_matching.

},
'expected_warnings': ['Unable to download f4m manifest'],
}, {
'url': 'http://www.espn.com/watch/player?id=19141491',
Copy link
Collaborator

Choose a reason for hiding this comment

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

only_matching.

},
'expected_warnings': ['Unable to download f4m manifest'],
}, {
'url': 'http://www.espn.com/watch/player?bucketId=257&id=19505875',
Copy link
Collaborator

Choose a reason for hiding this comment

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

only_matching.

@parmjitv
Copy link
Contributor Author

parmjitv commented Jul 4, 2017

I have applied the requested fixes, please review at your convenience. Thanks!

@parmjitv
Copy link
Contributor Author

parmjitv commented Jul 5, 2017

Shall I make any further corrections for this PR? Thank you!

)\.com/
(?:
video/clip(?:\?.*?\bid=|/_/id/)|
watch/player\?.*?\bid=
Copy link
Collaborator

Choose a reason for hiding this comment

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

)\.com/
(?:
video/clip(?:\?.*?\bid=|/_/id/)|
watch/player(?:\?.*?\bid=|/_/id/)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Code duplication.

@parmjitv
Copy link
Contributor Author

parmjitv commented Jul 5, 2017

Good catch - I have updated the regex and added this URL to the test suite for this extractor. Please let me know if there are any other issues. Thanks!

@dstftw dstftw merged commit 60d4401 into ytdl-org:master Jul 6, 2017
dstftw added a commit that referenced this pull request Jul 6, 2017
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