Skip to content

Fix 403 when downloading: Incorrect string slicing#15

Open
tonytwostep wants to merge 1 commit into
mvlnetdev:mainfrom
tonytwostep:patch-1
Open

Fix 403 when downloading: Incorrect string slicing#15
tonytwostep wants to merge 1 commit into
mvlnetdev:mainfrom
tonytwostep:patch-1

Conversation

@tonytwostep

@tonytwostep tonytwostep commented Sep 19, 2024

Copy link
Copy Markdown

The fix for #8 used the wrong string slicing, leading to it not actually fixing the issue. The conditional at line 39 would never get triggered, so the download_token won't be passed to the request.

Example of change with test string:

endpoint_example_string = "albums/ask1kblkcktmxw9a/dl"

# Existing slice
print(endpoint_example_string[:3])

# Proposal (fixed)
print(endpoint_example_string[-3:])

Output:

# Existing
alb

# Corrected
/dl

Please merge this before tagging a new release since the code currently in the main branch still has broken downloading. Thank you.

@tonytwostep tonytwostep changed the title Fix incorrect string slicing Fix 403 when downloading: Incorrect string slicing Sep 19, 2024
@angus-mcmahon

Copy link
Copy Markdown
Contributor

@tonytwostep #8 relates to the endpoint /dl/:hash.
I mentioned in #9 (comment) that there might be other endpoints that need to be fixed... looks like there is.

Your fix resolves the endpoint example you used, but breaks the hash endpoint.

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