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

[Duboku] Decrypt m3u8 url link #9161

Merged
merged 3 commits into from
Mar 9, 2024
Merged

Conversation

DmitryScaletta
Copy link
Contributor

@DmitryScaletta DmitryScaletta commented Feb 7, 2024

Description of your pull request and other information

player_data

{
  "flag": "play",
  "encrypt": 2,
  "trysee": 0,
  "points": 0,
  "link": "/vodplay/4283-1-1.html",
  "link_next": "",
  "link_pre": "/vodplay/4283-1-31.html",
  "url": "JTY4JTc0JTc0JTcwJTczJTNBJTJGJTJGJTczJTc0JTZEJTJFJTZFJTYyJTZGJTZCJTc1JTJFJTYzJTZGJTZEJTJGJTMyJTMwJTMyJTM0JTMwJTMyJTMwJTM3JTJGJTQ0JTRDJTcxJTM0JTQyJTUxJTQ1JTVBJTJGJTY5JTZFJTY0JTY1JTc4JTJFJTZEJTMzJTc1JTM4",
  "url_next": "",
  "from": "vidjs",
  "server": "no",
  "note": "",
  "id": "4283",
  "sid": 1,
  "nid": 32
}

https://u.duboku.io/static/js/player.js

if (player_data.encrypt == "1") {
  player_data.url = unescape(player_data.url);
  player_data.url_next = unescape(player_data.url_next);
} else if (player_data.encrypt == "2") {
  player_data.url = unescape(base64decode(player_data.url));
  player_data.url_next = unescape(base64decode(player_data.url_next));
}

Fixes #9159

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?

yt_dlp/extractor/duboku.py Outdated Show resolved Hide resolved
@seproDev seproDev added the site-bug Issue with a specific website label Feb 8, 2024
@dirkf
Copy link
Contributor

dirkf commented Feb 9, 2024

Download tests are failing with 401 from the UK on getting the "m3u8 information": is that expected?

@DmitryScaletta
Copy link
Contributor Author

DmitryScaletta commented Feb 19, 2024

They use Cloudflare DDoS Protection now.
Extraction no longer works.
But it works fine with User-Agent header and cf_clearance cookie.

It doesn't work with Cookie from Firefox and User-Agent from Chrome and vice versa.
Looks like User-Agent must match exactly where the cookie was obtained from.
Changing even one character doesn't work.

@coletdjnz
Copy link
Member

#7595 may help with that

@bashonly
Copy link
Member

bashonly commented Feb 19, 2024

I'm still getting 403'd with curl_cffi/curl-impersonate. They may have enabled cloudflare's "I'm Under Attack" mode, where a JS challenge is required no matter what (unless you pass cookies from a session that has already passed the challenge, as Dmitry said)

Copy link
Member

@seproDev seproDev left a comment

Choose a reason for hiding this comment

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

No longer has a CF challenge for me

yt_dlp/extractor/duboku.py Outdated Show resolved Hide resolved
@dirkf
Copy link
Contributor

dirkf commented Mar 9, 2024

Yes, the same tests that failed before are passing now.

@bashonly bashonly merged commit d3d4187 into yt-dlp:master Mar 9, 2024
6 checks passed
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
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.

duboku no longer working
6 participants