rsnitsch / py3createtorrent

Create torrents via command line!
Other
72 stars 7 forks source link

About RegEx issue #10

Closed Suitear closed 2 years ago

Suitear commented 3 years ago

When I want to use the -e option to exclude specific file types like rar, r00, r01, r02,... r99, etc.

-exclude-pattern '^.*\.r.*$'

image

It gives such error. image

But this RegEx is OK with the following command,
ls |grep -E '^.*\.r.*$' So I am wondering if py3createtorrent only support RegEx formats in your examples, like "(jpg|JPG)$" only?

rsnitsch commented 3 years ago

Try again with --exclude-pattern (double dash) instead of -exclude-pattern. Python uses single dash for short switches (for example -h) or double dash for long switches (for example --help).

Suitear commented 3 years ago

Try again with --exclude-pattern (double dash) instead of -exclude-pattern. Python uses single dash for short switches (for example -h) or double dash for long switches (for example --help).

Thanks. the following command works. Much appreciated. --exclude-pattern "(^.*\.r.*|sfv)$"

Another issue here. I used to use mktorrent which can support ‘relative path'. But it seems py3createtorrent can't support 'relative path' here. For example, If I use it like this, py3createtorrent -v -p 8192 -P -s FL -o ~/example.torrent -d -1 -t https://tracker/announce.php --exclude-pattern "(^.*\.r.*|sfv)$" ./ It will create a torrent with a wierd name [. ] in its name field, and I can't add this torrent to my torrent client anyway. image

If I change the path to full path, the torrent created will be OK.

rsnitsch commented 2 years ago

Thank you for reporting the relative path issue. I can confirm that this is a bug. I created a separate issue for that, though. See #11