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

[DoodStream] Add extractor #32979

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

mp3butcher
Copy link

@mp3butcher mp3butcher commented Nov 23, 2024

update of outdated extractors:
Closes #28903.
Closes #28008.
Closes #31003

@mp3butcher mp3butcher force-pushed the d00dstream branch 3 times, most recently from de01b5d to 6456200 Compare November 23, 2024 19:54
@mp3butcher mp3butcher changed the title [DoodStream] Add extractor from yt-dlp back-port [DoodStream] Add extractor Nov 23, 2024
@mp3butcher mp3butcher force-pushed the d00dstream branch 3 times, most recently from 31d3220 to dde081c Compare November 23, 2024 22:47
Copy link
Contributor

@dirkf dirkf left a comment

Choose a reason for hiding this comment

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

Thanks for the update and decoding the pass_md5/token stuff.

I've made some comments for information, but I'll apply the changes to the old PR with attribution. The question to be settled is whether the '/d/' page ever embeds a link other than the matching '/e/' page.

youtube_dl/extractor/doodstream.py Outdated Show resolved Hide resolved
youtube_dl/extractor/doodstream.py Outdated Show resolved Hide resolved
youtube_dl/extractor/doodstream.py Outdated Show resolved Hide resolved
youtube_dl/extractor/doodstream.py Show resolved Hide resolved
auth_url = ('https://%s/' % host) + self._html_search_regex(
r'(/pass_md5.*?)\'', webpage, 'pass_md5')
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/66.0',
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem to be necessary:

Suggested change
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/66.0',

Comment on lines 80 to 81
final_url = authpage + ''.join([random.choice(string.ascii_letters + string.digits) for _ in
range(10)]) + "?token=" + token + "&expiry=" + str(int(time.time() * 1000))
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer (with whatever indentation flake8 allows):

Suggested change
final_url = authpage + ''.join([random.choice(string.ascii_letters + string.digits) for _ in
range(10)]) + "?token=" + token + "&expiry=" + str(int(time.time() * 1000))
final_url = update_url_query(
authpage + ''.join((random.choice(string.ascii_letters + string.digits)
for _ in range(10))), {
'token': token,
'expiry': int(time.time() * 1000),
})

But in the original, s/str/compat_str/.

youtube_dl/extractor/doodstream.py Outdated Show resolved Hide resolved
youtube_dl/extractor/doodstream.py Outdated Show resolved Hide resolved
youtube_dl/extractor/doodstream.py Outdated Show resolved Hide resolved
youtube_dl/extractor/doodstream.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants