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

Fix double decode of file url #144

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

Conversation

antonsoroko
Copy link

@antonsoroko antonsoroko commented Oct 26, 2024

  1. Remove DecodeFileURL from TorrentFS.Open()

URL is already decoded (you can print it to check, i guess it is decoded by library, although i have not found this in docs, but it is definitely already decoded), so if raw file path has special characters - then it will be unnecessarily "decoded" again and file will not be found.

e.g. if path has %7C in name. (it supposed to be | but was encoded by publishing software, i guess)

example of such strange file path:
https://animaunt.org/13543-napadenie-odinochki-na-inoy-mir.html
https://animaunt.org/13859-proschay-zhizn-drakona-zdravstvuy-zhizn-cheloveka.html
Прощай, жизнь дракона. Здравствуй, жизнь человека %7C Sayounara Ryuusei, Konnichiwa Jinsei
Нападение одиночки на иной мир %7C Hitoribocchi no Isekai Kouryaku

i tested my change on 16 different torrents - all ok.

  1. Add EncodeFileURL for Audio file
    like it was done for subtitles earlier escape path for subtitles #52
    and how it was done for video from the beggining.

  2. Add small debug message to TorrentFile.Download() to see what headers we add when we download .torrent file.

URL is already decoded, so if raw file path has special characters - then it will be unnecessarily "decoded" and file will not be found.
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.

1 participant