#1 Does this mean that soon this script will stop working?

Open
opened 1 year ago by akimdi · 5 comments
akimdi commented 1 year ago

Your script is very helpful. I use them all the time. I don't know much about python. These errors that have begun to appear, can they be ignored?

Python 3.10.9

magnet-dl.py:42: DeprecationWarning: add_magnet_uri() is deprecated handle = lt.add_magnet_uri(ses, magnet_string, params) magnet-dl.py:43: DeprecationWarning: has_metadata() is deprecated while (not handle.has_metadata()): magnet-dl.py:45: DeprecationWarning: get_torrent_info() is deprecated info = handle.get_torrent_info() magnet-dl.py:47: DeprecationWarning: set_sequential_download() is deprecated h.set_sequential_download(True)

Does this mean that soon this script will stop working?

Your script is very helpful. I use them all the time. I don't know much about python. These errors that have begun to appear, can they be ignored? Python 3.10.9 `magnet-dl.py:42: DeprecationWarning: add_magnet_uri() is deprecated handle = lt.add_magnet_uri(ses, magnet_string, params) magnet-dl.py:43: DeprecationWarning: has_metadata() is deprecated while (not handle.has_metadata()): magnet-dl.py:45: DeprecationWarning: get_torrent_info() is deprecated info = handle.get_torrent_info() magnet-dl.py:47: DeprecationWarning: set_sequential_download() is deprecated h.set_sequential_download(True)` Does this mean that soon this script will stop working?
mai commented 1 year ago
Owner

Hello! I havn't used this program in a while, but I used to use it all the time. Also gmail put this notification in my spam folder, so I apologize for taking a little time to respond.

To get straight to business: This script is just a build off of the example shown on the libtorrent page on the python binding.

https://www.libtorrent.org/python_binding.html

The python specific docs are basically non existent and only this example is provided, but the C++ info is more or less usable to hack together functionality...

You are correct: those methods / functions it seems are being deprecated, looks like libtorrent got some work done to it since I made this little script. Luckily the example was updated too.

Unfortunately I left magnet-dl.py in a a VERY crufty state where I did intend to clean it up and add features, but never did because it did what it needed to do.

So I spent a little time today adapting the new example to accept magnet links. Take a look at magdl2.py in the latest commit

Some things I left out was accepting only a 40 character hash. I didn't include this because it seems like a bad idea nowadays to assume what tracker to start you out on. So now the only accepted argument is a quoted magnet string.

Also for printing info after it is received: I didn't include it because its not strictly necessary and will take a bit of trial and error to correlate the correct way to get this info from the C++ docs. mainly though I am just short on time nowadays.

Thanks for the bug report and if you need anymore help, just let me know :-)

Hello! I havn't used this program in a while, but I used to use it all the time. Also gmail put this notification in my spam folder, so I apologize for taking a little time to respond. To get straight to business: This script is just a build off of the example shown on the libtorrent page on the python binding. https://www.libtorrent.org/python_binding.html The python specific docs are basically non existent and only this example is provided, but the C++ info is more or less usable to hack together functionality... You are correct: those methods / functions it seems are being deprecated, looks like libtorrent got some work done to it since I made this little script. Luckily the example was updated too. Unfortunately I left magnet-dl.py in a a VERY crufty state where I did intend to clean it up and add features, but never did because it did what it needed to do. So I spent a little time today adapting the new example to accept magnet links. Take a look at magdl2.py in the latest commit Some things I left out was accepting only a 40 character hash. I didn't include this because it seems like a bad idea nowadays to assume what tracker to start you out on. So now the only accepted argument is a quoted magnet string. Also for printing info after it is received: I didn't include it because its not strictly necessary and will take a bit of trial and error to correlate the correct way to get this info from the C++ docs. mainly though I am just short on time nowadays. Thanks for the bug report and if you need anymore help, just let me know :-)
akimdi commented 1 year ago
Poster

I keep getting an error.

python ./magdl2.py "magnet:?xt=urn:btih:fef84077088ca87ffd8afd644d0ef957d96243c3&dn=archlinux-2023.01.01-x86_64.iso"
starting archlinux-2023.01.01-x86_64.iso
100.00% complete (down: 8367.5 kB/s up: 405.6 kB/s peers: 3) seeding Traceback (most recent call last):
  File "./magdl2.py", line 53, in <module>
    print(h.status().name, 'complete')
NameError: name 'h' is not defined

I commented line 53 magdl2.py#L53

Is it okay if I did that?

I keep getting an error. ``` python ./magdl2.py "magnet:?xt=urn:btih:fef84077088ca87ffd8afd644d0ef957d96243c3&dn=archlinux-2023.01.01-x86_64.iso" starting archlinux-2023.01.01-x86_64.iso 100.00% complete (down: 8367.5 kB/s up: 405.6 kB/s peers: 3) seeding Traceback (most recent call last): File "./magdl2.py", line 53, in <module> print(h.status().name, 'complete') NameError: name 'h' is not defined ``` I commented line 53 [magdl2.py#L53](https://notabug.org/mai/magnet-dl/src/master/magdl2.py#L53) Is it okay if I did that?
mai commented 1 year ago
Owner

Yep, It's just because I changed the example to have better variable names ('handle' rather than 'h') but missed that last line. I fixed it and cleaned up the rest of the code too.

Let me know if there is any features you would like, and I could try to work on it when I have the time.

Cheers

Update: I renamed magdl2.py back to magnet-dl.py

Yep, It's just because I changed the example to have better variable names ('handle' rather than 'h') but missed that last line. I fixed it and cleaned up the rest of the code too. Let me know if there is any features you would like, and I could try to work on it when I have the time. Cheers Update: I renamed magdl2.py back to magnet-dl.py
akimdi commented 1 year ago
Poster

I'm taking a long time to answer because notabug constantly gives a 500 error.

I'm taking a long time to answer because notabug constantly gives a 500 error.
akimdi commented 1 year ago
Poster

I'm taking a long time to answer because notabug constantly gives a 500 error.

I'm taking a long time to answer because notabug constantly gives a 500 error.
Sign in to join this conversation.
No Label
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.