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

[Soundcloud] Download Soundcloud GO+ high quality streams #32311

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

Conversation

unkernet
Copy link
Contributor

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:

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

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Added ability to download high quality 256k AAC streams with a Soundcloud GO+ account using cookies
This is not the same as a #26265

python3 -m youtube_dl -F --cookies soundcloud.com_cookies.txt https://soundcloud.com/g-e-j-u/bm-geju-fractoids-garden-220831
[soundcloud] g-e-j-u/bm-geju-fractoids-garden-220831: Downloading webpage
[soundcloud] 1371317128: Downloading JSON metadata
[soundcloud] 1371317128: Downloading JSON metadata
[soundcloud] 1371317128: Downloading JSON metadata
[soundcloud] 1371317128: Downloading JSON metadata
[soundcloud] 1371317128: Downloading JSON metadata
[info] Available formats for 1371317128:
format code   extension  resolution note
hls_opus_64   opus       audio only audio@ 64k
hls_mp3_128   mp3        audio only audio@128k
hls_aac_256   aac        audio only audio@256k
http_mp3_128  mp3        audio only audio@128k
http_aac_256  aac        audio only audio@256k (best)

@dirkf
Copy link
Contributor

dirkf commented Jul 18, 2023

Would you be able to propose this in #30998 instead?

@unkernet
Copy link
Contributor Author

Sure. After that PR accepted I will add OAuth token extraction from the cookies

'url': format_url,
'preference': 10,
'abr': (filesize and duration) and (filesize / duration * 8),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'abr': (filesize and duration) and (filesize / duration * 8),
'abr': int_or_none(filesize, invscale=8, scale=duration)

@@ -319,6 +324,7 @@ def _extract_info_dict(self, info, full_title=None, secret_token=None):
track_id = compat_str(info['id'])
title = info['title']

duration = info.get('duration')
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use this in the returned info-dict, l.467 ?

@@ -293,6 +293,11 @@ def _download_json(self, *args, **kwargs):
if non_fatal:
Copy link
Contributor

@dirkf dirkf Jul 4, 2024

Choose a reason for hiding this comment

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

The condition above is too specific. The definition of InfoExtractor._download_json() that is being overridden makes fatal just a truthy/falsey value with default True. It should say:

        non_fatal = not kwargs.get('fatal', True)

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.

None yet

2 participants