vikstrous / pirate-get

A command line interface for The Pirate Bay
GNU Affero General Public License v3.0
337 stars 53 forks source link

Front slash in torrent name treated as file path #73

Closed ghost closed 8 years ago

ghost commented 8 years ago

Attempting to download a torrent file with a name including a front slash into a local directory throws a "FileNotFoundError"

vikstrous commented 8 years ago

Makes sense. That code path is pretty hacky. We need to sanitize the torrent names. Would it make sense to replace \ and / with _?

Edit: I just saw this comment: "# TODO: handle slashes in torrent names"

rnhmjoj commented 8 years ago

Why would the filename even contain such a character? It is forbidden on every *nix system and it seems to be the same even for windows.

vikstrous commented 8 years ago

It's not a filename. We are using it to name our files, but it's just the name of the torrent. The server can provide anything.

rnhmjoj commented 8 years ago

Ah, makes sense.