-
Notifications
You must be signed in to change notification settings - Fork 10k
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
[spreaker] Add new extractor #13877
[spreaker] Add new extractor #13877
Conversation
youtube_dl/extractor/spreaker.py
Outdated
_VALID_URL = r"""(?x)^ | ||
https?:// | ||
(?:www.|api.)? | ||
spreaker.com/ |
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.
Dots must be escaped.
youtube_dl/extractor/spreaker.py
Outdated
(?: | ||
show/[a-z0-9_-]+| | ||
user/[a-z0-9_-]+/[a-z0-9_-]| | ||
episode/(?P<id>[0-9]+) |
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.
Each should be a separate extractor.
youtube_dl/extractor/spreaker.py
Outdated
}, | ||
{ | ||
'url': ('https://www.spreaker.com/user/9780658/swm-ep15-how-to-' | ||
'market-your-music-part-2'), |
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.
Don't carry URLs.
youtube_dl/extractor/spreaker.py
Outdated
] | ||
|
||
def _spreaker_episode_data_to_info(self, data): | ||
upload_date = data['published_at'][0:10].replace('-', '') |
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.
Should not break if published_at
is missing.
youtube_dl/extractor/spreaker.py
Outdated
if not author: | ||
author = {} | ||
stats = data.get('stats') | ||
view_count = like_count = comment_count = 0 |
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.
Lack of information is denoted by None
.
youtube_dl/extractor/spreaker.py
Outdated
view_count = like_count = comment_count = 0 | ||
show = data.get('show') | ||
if not show: | ||
show = {} |
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.
show = data.get('show') or {}
youtube_dl/extractor/spreaker.py
Outdated
show = {} | ||
else: | ||
show_image = show.get('image') | ||
if not show_image: |
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.
Reference before assignment for show_image
if not show
.
Escape . in regexes Make separate extractors for episode page, playlist (show), API Support API's direct links to MP3 files Make counts set to None in case they are not found Handle when published_at is not present Other fixes
@dstftw This is ready to go on my end. |
@Tatsh I am also looking for this. Do you plan on finishing it? Was thinking about starting a new PR. |
@peterk I pushed new code up with the requested changes from @dstftw. This should be good to go now. I suggest maintaining a local branch of your own, merging master and merging the pull requests you like. This way you can use the newest features and stay up-to-date with master. Just don't use this branch for pull requests (always start with master). |
Is there an update on this? |
@dstftw Please review again since the last commit. |
Bump |
bump, still doesn't work |
@rudolphos This version works fine. |
I'm using the latest version and it doesn't work
|
@dstftw If you want me to make changes, I'll need to re-make this PR. I asked GitHub and they cannot fix branch references. |
Picked some code in 686e898. Thanks. |
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])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
Extractor for Spreaker.com podcast site. Fixes issue #13480