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

Windows 10: How to edit source and create new torrent in Batch Mode? #27

Closed
kdantas opened this issue Oct 9, 2021 · 13 comments
Closed

Comments

@kdantas
Copy link

kdantas commented Oct 9, 2021

Hi, I have a folder with 50 .torrent files. How can I run torf-cli to change the annouce and the source of these 50 .torrent files in batch mode? And, is there any way to run torf-cli in Windows terminal? Thanks in advance.

PS: I installed pipx in my window and then I installed torf. But I got this error below when run torf. Any idea how to solve this problem?

C:\>torf -i Mirc.torrent Traceback (most recent call last): File "c:\python38\lib\runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\python38\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\torf.exe\__main__.py", line 7, in <module> File "C:\Users\xandynho\AppData\Roaming\Python\Python38\site-packages\torfcli\__init__.py", line 16, in run from . import _config, _errors, _main, _ui File "C:\Users\xandynho\AppData\Roaming\Python\Python38\site-packages\torfcli\_ui.py", line 24, in <module> from . import _term, _utils, _vars File "C:\Users\xandynho\AppData\Roaming\Python\Python38\site-packages\torfcli\_term.py", line 14, in <module> import termios ModuleNotFoundError: No module named 'termios'

@kdantas kdantas changed the title How to edit source and create new torrent in Batch Mode? Windows 10: How to edit source and create new torrent in Batch Mode? Oct 9, 2021
@rndusr
Copy link
Owner

rndusr commented Oct 9, 2021 via email

@kdantas
Copy link
Author

kdantas commented Oct 9, 2021

I don't know what "batch mode" means, but I don't think torf-cli has one. I would do it with a for loop. How to do it specifically depends on your shell, the files and what you want to do. No idea how to get torf-cli working on Windows, especially if you don't provide any error messages.

Hi @rndusr, thanks for your reply. Batch reply means, in general, what you wrote, run it with a for loop. And about the error message running in windows, you can check in my main post. But see below again...

C:>torf -i Mirc.torrent

Traceback (most recent call last):
File "c:\python38\lib\runpy.py", line 193, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\python38\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\torf.exe_main
.py", line 7, in
File "C:\Users\xandynho\AppData\Roaming\Python\Python38\site-packages\torfcli_init
.py", line 16, in run
from . import _config, _errors, _main, _ui
File "C:\Users\xandynho\AppData\Roaming\Python\Python38\site-packages\torfcli_ui.py", line 24, in
from . import _term, _utils, _vars
File "C:\Users\xandynho\AppData\Roaming\Python\Python38\site-packages\torfcli_term.py", line 14, in
import termios
ModuleNotFoundError: No module named 'termios'

But I think the problem must be about this last line... ModuleNotFoundError: No module named 'termios'. I read that this termios module can´t be installed on Windows. Anyway, I'll keep looking for a solution to run TORF on windows.

@rndusr
Copy link
Owner

rndusr commented Oct 10, 2021 via email

@rndusr
Copy link
Owner

rndusr commented Oct 10, 2021 via email

@kdantas
Copy link
Author

kdantas commented Oct 11, 2021

Thanks for providing an error. (I don't get another email if you edit a comment, that's why I didn't see it.) I think I can fix this particular issue, but I can't test it, so expect more bugs.

Hey @rndusr, do you really can fix this problem? Maybe creating a patch. I can test here and give you a feedback. Please, let me know. I would like to run TORF on windows. Regards.

@rndusr
Copy link
Owner

rndusr commented Oct 12, 2021 via email

@kdantas
Copy link
Author

kdantas commented Oct 12, 2021

I think I have fixed the ModuleNotFoundError. Please install/clone the master branch on GitHub and report if it works or if you get a different error message.

Keeping the same error...

C:\Users\xandynho>Pipx install https://github.com/rndusr/torf-cli/archive/refs/heads/master.zip --force
Installing to existing venv 'torf-cli'
⚠️ Note: torf.exe was already on your PATH at c:\users\xandynho\appdata\roaming\python\python38\scripts\torf.exe
installed package torf-cli 3.4.0, Python 3.8.2
These apps are now globally available
- torf.exe
done! ✨ 🌟 ✨

C:\Users\xandynho>torf
Traceback (most recent call last):
File "c:\python38\lib\runpy.py", line 193, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\python38\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "c:\users\xandynho.local\bin\torf.exe_main
.py", line 7, in
File "C:\Users\xandynho.local\pipx\venvs\torf-cli\lib\site-packages\torfcli_init
.py", line 16, in run
from . import _config, _errors, _main, _ui
File "C:\Users\xandynho.local\pipx\venvs\torf-cli\lib\site-packages\torfcli_ui.py", line 24, in
from . import _term, _utils, _vars
File "C:\Users\xandynho.local\pipx\venvs\torf-cli\lib\site-packages\torfcli_term.py", line 14, in
import termios
ModuleNotFoundError: No module named 'termios'

@rndusr
Copy link
Owner

rndusr commented Oct 12, 2021 via email

@kdantas
Copy link
Author

kdantas commented Oct 13, 2021

You're not using master. The traceback you're posting complains about line 14 in _term.py, which is "import termios", but that's not what that line says in master: https://github.com/rndusr/torf-cli/blob/master/torfcli/_term.py#L14

I am doing something wrong? Is this link (https://github.com/rndusr/torf-cli/archive/refs/heads/master.zip) correct or not for master? Any suggest? My knowledgement in linux and terminal commands is not so good, but I am trying to do my best.

@kdantas kdantas closed this as completed Oct 13, 2021
@kdantas kdantas reopened this Oct 13, 2021
@kdantas
Copy link
Author

kdantas commented Oct 13, 2021

Hey @rndusr, it's working normal now. I replaced the contents of the torfcli folder with the files from master.zip. Thank you so much. However, strange characters are appearing at the end of lines of text. Maybe some other module is causing this problem.
Strange Character

@rndusr
Copy link
Owner

rndusr commented Oct 13, 2021 via email

@kdantas
Copy link
Author

kdantas commented Oct 13, 2021

I don't know why installing master with pipx didn't work for you. I would've used this command: pipx install 'git+git://github.com/plotski/upsies.git' The strange characters are control characters for cursor movement, clearing the current line, etc. They are usually supported on Unix terminals, but your terminal doesn't seem to understand them. It's not hard to fix this in principle, but I don't know anything about the terminal you're using. I would need to know how to detect it and the control characters it supports.

Hi @rndusr, I'm using Windows 10 command prompt (cmd). If you can help me to fix these strange characters, that would be nice. And about the install command I used: pipx install https://github.com/rndusr/torf-cli/archive/refs/heads/master.zip --force. I really don't know why it didn't work. Anyway, the important thing is that it is now working normally on windows 10.

@kdantas
Copy link
Author

kdantas commented Oct 14, 2021

Hi @rndusr, I'm sharing a file (LinesEnd.txt) where I saved the strange characters on windows. When you have time, see if you can fix this problem. Thank you very much.

http://www.fileconvoy.com/dfl.php?id=g6398d39df890191a1000384114599c25c687db68b0

Looking on google, I found some articles that shows how to check what these strange characters represent. Perhaps these information can help you find the solution. These tests were done on Windows WSL running Ubuntu 18.04.4 LTS. Best Regards.

kdantas@LAPTOP-J2M6QHEU:/mnt/c/users/xandynho/desktop$ cat -e LinesEnd.txt
Name Mirc.torrent^[[K^M$
Info Hash f8ebd04c5e10ee5c32564c6ca6b8ec342f3c2016^[[K^M$
Size 3.35 KiB^[[K^M$
Created 2021-10-12 22:19:20^[[K^M$
Created By torf 3.4.0^[[K^M$
Piece Size 16 KiB^[[K^M$
Piece Count 1^[[K^M$
File Count 1^[[K^M$
Files Mirc.torrent [3.35 KiB]^[[K^M$
Magnet magnet:?xt=urn:btih:f8ebd04c5e10ee5c32564c6ca6b8ec342f3c2016&dn=Mirc.torrent&xl=3431^[[K

kdantas@LAPTOP-J2M6QHEU:/mnt/c/users/xandynho/desktop$ cat -v LinesEnd.txt
Name Mirc.torrent^[[K^M
Info Hash f8ebd04c5e10ee5c32564c6ca6b8ec342f3c2016^[[K^M
Size 3.35 KiB^[[K^M
Created 2021-10-12 22:19:20^[[K^M
Created By torf 3.4.0^[[K^M
Piece Size 16 KiB^[[K^M
Piece Count 1^[[K^M
File Count 1^[[K^M
Files Mirc.torrent [3.35 KiB]^[[K^M
Magnet magnet:?xt=urn:btih:f8ebd04c5e10ee5c32564c6ca6b8ec342f3c2016&dn=Mirc.torrent&xl=3431^[[K

kdantas@LAPTOP-J2M6QHEU:/mnt/c/users/xandynho/desktop$ file LinesEnd.txt
LinesEnd.txt: ASCII text, with CRLF line terminators, with escape sequences

kdantas@LAPTOP-J2M6QHEU:/mnt/c/users/xandynho/desktop$ file -k LinesEnd.txt
LinesEnd.txt: ASCII text, with CRLF line terminators, with escape sequences\012- data

@rndusr rndusr closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
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

No branches or pull requests

2 participants