Skip to content

Conversation

@szero
Copy link

@szero szero commented May 13, 2017

I noticed that program doesn't properly unquote filenames if we want to use filename contained in magnet itself. It won't unquote filenames that don't contain + symbol. Since escape character for space is %20, I think it makes more sense to unquote if the filename contains % symbol.

@LordAro
Copy link
Owner

LordAro commented May 13, 2017

It's been a while since I looked at this, can you summarise the differences in output, and give examples?

@szero
Copy link
Author

szero commented May 13, 2017 via email

if '%' in output_name:
output_name = unquote(output_name)
output_name += '.torrent'
try:
Copy link
Author

@szero szero May 13, 2017

Choose a reason for hiding this comment

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

If we will run the script as such:

Magnet2Torrent.py -m <our magnet without dn parameter>

The script will return with IndexError. I changed the program operation, to proceed if dn field is not present and set torrent name from torrent field.

output = pt.abspath(self.output_name)
else:
output = pt.abspath(torinfo.name() + ".torrent")

Copy link
Author

Choose a reason for hiding this comment

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

If self.output_name is None, set the torrent name from the torrent handle.

@rachmadaniHaryono
Copy link

rachmadaniHaryono commented Jun 9, 2017

hi @szero i just realize that you have already create pull request for your fix.

i add 2 little edit to it.

after that @LordAro can merge it with upstream branch from @danfolkes.

but, should i add pr to your branch first?

#2

@szero
Copy link
Author

szero commented Jun 10, 2017

@rachmadaniHaryono thanks for interest in this. I have some uncommitted changes because this PR wasn't merged yet. It adds better handling for cases with pluses in magnet. Here is my patch:
https://gist.github.com/Szero/eaed988e7baf76013b21760822d67380
I would like you to check this patch in regard to your changes. If you think that my changes are all right, please create a PR to my repo, and I will merge it.

@rachmadaniHaryono
Copy link

@szero ok i will cancel my other pr, add the patch and my commits to your branch first so it can be merged on this pr.

@LordAro LordAro merged commit f0df30d into LordAro:master Jun 12, 2017
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.

3 participants