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

[SpankBangPlaylist] Add new extractor #19145

Closed
wants to merge 3 commits into from
Closed

[SpankBangPlaylist] Add new extractor #19145

wants to merge 3 commits into from

Conversation

JChris246
Copy link
Contributor

Please follow the guide below

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

[SpankBangPlaylist] New extractor

New extractor to pull spankbang playlists
Adjusted spankbang regex to recognize single playlist videos

@@ -12,7 +12,7 @@


class SpankBangIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|m|[a-z]{2})\.)?spankbang\.com/(?P<id>[\da-z]+)/video'
_VALID_URL = r'https?://(?:(?:www|m|[a-z]{2})\.)?spankbang\.com/(?P<id>[\da-z-]+)/(?:video|playlist)'
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should not match playlist URLs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was to match single playlist videos..but i changed it back

youtube_dl/extractor/spankbang.py Outdated Show resolved Hide resolved
'http://www.%s/%s' % ('spankbang.com', video_url),
SpankBangIE.ie_key())
for video_url in re.findall(
r'href="/?([\da-z-]+/playlist/[^"]+)', webpage)
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. This is too broad, regex should be restricted by playlist id.
  2. This captures duplicates.

youtube_dl/extractor/spankbang.py Outdated Show resolved Hide resolved
youtube_dl/extractor/spankbang.py Outdated Show resolved Hide resolved
…ate duplicate video capture, playlist title is no longer fatal, used _match_id
r'href="/?(' + id + '-[\da-z]+/playlist/[^"]+)', div, 'page url', default=None)

if page_url:
page = self._download_webpage(urljoin('http://spankbang.com', page_url), id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

No. It's a job if the video 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.

This is needed to get the canonical url for the single video extractor [SpankBang] to use

Copy link
Collaborator

Choose a reason for hiding this comment

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

Again: video URLs are already available on playlist page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these urls are in the for /playlist_id-playlist_item_id/playlist/playlistname
even if you replace playlist with video and only use the playlist_item_id it does point to the the actual video url

Copy link
Contributor Author

Choose a reason for hiding this comment

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

*does not

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not talking about these URLs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where are they

youtube_dl/extractor/spankbang.py Outdated Show resolved Hide resolved
youtube_dl/extractor/spankbang.py Outdated Show resolved Hide resolved
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