-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
[ie/puhutv] Fix playlists extraction #11955
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
Conversation
Pls add or update tests |
|
@pukkandan I've fixed tests and made the requested changes. Could you please take another look when you get a chance? Thanks! |
Worked FYI @pukkandan @e2dk4r |
Did you capture data from mobile app traffic? @e2dk4r I searched the web for a long time but could not find a place where I could get the data. I even thought that it was generated in the same order as it was built. Because in some response values, I saw the IP address in places like Türk Telekom, National Academic Network. I do not use either provider. |
Yes. My setup is: $ mitmproxy --mode wireguard
Additionaly if target app uses certificate pinning, remove that. |
This commit fixes extracting playlist or episodes from *-detay (e.g. https://puhutv.com/deha-detay). This data extracted from android app.
|
Please do not force push, it makes reviewing difficult |
yt_dlp/extractor/puhutv.py
Outdated
video_id = info.get('slug') or info['assets'][0]['slug'] | ||
video_id = (info['slug'] or info['assets'][0]['slug']).removesuffix('-detay').removesuffix('-izle') | ||
return self.url_result( | ||
f'https://puhutv.com/{video_id}-izle', | ||
PuhuTVIE.ie_key(), video_id) | ||
f'https://puhutv.com/{video_id}-izle', PuhuTVIE, video_id) |
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.
can you explain what's going on here please
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.
Slug has suffix that have -detay
in .data.slug
path of json or -izle
for .data.assets[0].slug
$ curl -sSL https://puhutv.com/api/slug/bizim-icin-sampiyon-detay | jq -r .data.slug
bizim-icin-sampiyon-detay
$ curl -sSL https://puhutv.com/api/slug/bizim-icin-sampiyon-detay | jq -r .data.assets[0].slug
bizim-icin-sampiyon-izle
I did not see any response without .data.slug
but I did not test every show on there. I know removing same suffix then adding it seems redundant.
We could use slug extracted from url without extracting from json, would that be better?
url = 'https://puhutv.com/bizim-icin-sampiyon-detay'
playlist_id = 'bizim-icin-sampiyon'
...
video_id = playlist_id
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.
Description
Fixes #5691
This commit fixes extracting playlist or episodes from *-detay (e.g. https://puhutv.com/deha-detay).
If you want to see network capture, you can use https://mitmproxy.org/
Archive: puhutv.mitmproxy.tar.gz
Template
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:
What is the purpose of your pull request?