Skip to content

Conversation

e2dk4r
Copy link
Contributor

@e2dk4r e2dk4r commented Dec 30, 2024

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

# to see network capture in terminal
$ mitmproxy -r puhutv-deniz-yildizi.flow
# or in web client
$ mitmweb -r puhutv-deniz-yildizi.flow
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:

  • 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?

@pukkandan pukkandan added the site-bug Issue with a specific website label Jan 5, 2025
@pukkandan
Copy link
Member

Pls add or update tests

@e2dk4r
Copy link
Contributor Author

e2dk4r commented Jan 6, 2025

@e2dk4r
Copy link
Contributor Author

e2dk4r commented Jan 23, 2025

@pukkandan I've fixed tests and made the requested changes. Could you please take another look when you get a chance? Thanks!

@ramazansancar
Copy link

Worked FYI @pukkandan @e2dk4r

@ramazansancar
Copy link

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.

@e2dk4r
Copy link
Contributor Author

e2dk4r commented Apr 7, 2025

Did you capture data from mobile app traffic? @e2dk4r

Yes. My setup is:

  1. Start mitmproxy in wireguard mode
$ mitmproxy --mode wireguard
  1. Connect to mitmproxy with WireGuard client from android.
    This is a VPN connection.
  2. Open target app and see the requests

Additionaly if target app uses certificate pinning, remove that.

@bashonly bashonly self-assigned this Aug 16, 2025
@bashonly bashonly added the pending-fixes PR has had changes requested label Aug 16, 2025
This commit fixes extracting playlist or episodes from *-detay (e.g.
https://puhutv.com/deha-detay).

This data extracted from android app.
@e2dk4r
Copy link
Contributor Author

e2dk4r commented Aug 16, 2025

@e2dk4r e2dk4r requested a review from bashonly August 16, 2025 13:40
@bashonly
Copy link
Member

Please do not force push, it makes reviewing difficult

@bashonly bashonly removed the pending-fixes PR has had changes requested label Aug 16, 2025
Comment on lines 229 to 228
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)
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

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

@bashonly bashonly changed the title [ie/puhutv] Fix extracting playlist [ie/puhutv] Fix playlists extraction Aug 19, 2025
@bashonly bashonly merged commit 36e8738 into yt-dlp:master Aug 19, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Playlist/serie support for puhutv.com
4 participants