Jorman / Scripts

Some script, forked and not to make me crazy!
MIT License
226 stars 28 forks source link

AddTransmissionTrackers.sh failing to add trackers #11

Closed ragebflame closed 2 years ago

ragebflame commented 2 years ago

Hi,

I am running the AddTransmissionTrackers.sh script manually on a torrent of ID 1:

AddTransmissionTrackers.sh 1

Output shows that it failed to add the trackers:

For the Torrent: 
Private tracker list present, checking if the torrent is private
The torrent is not private, I'll inject trackers on it
Tracker file exist, I'll check if I need to upgrade it
File /root/TorrentTrackersList is not older than 1 days and I don't need to upgrade it
1/20 - Adding tracker udp://tracker.opentrackr.org:1337/announce - < Failed > 
2/20 - Adding tracker udp://open.tracker.cl:1337/announce - < Failed > 
3/20 - Adding tracker udp://9.rarbg.com:2810/announce - < Failed > 
4/20 - Adding tracker http://tracker.openbittorrent.com:80/announce - < Failed > 
5/20 - Adding tracker udp://tracker.openbittorrent.com:6969/announce - < Failed > 
6/20 - Adding tracker udp://opentracker.i2p.rocks:6969/announce - < Failed > 
7/20 - Adding tracker https://opentracker.i2p.rocks:443/announce - < Failed > 
8/20 - Adding tracker udp://www.torrent.eu.org:451/announce - < Failed > 
9/20 - Adding tracker udp://tracker.torrent.eu.org:451/announce - < Failed > 
10/20 - Adding tracker udp://open.stealth.si:80/announce - < Failed > 
11/20 - Adding tracker udp://ipv4.tracker.harry.lu:80/announce - < Failed > 
12/20 - Adding tracker udp://exodus.desync.com:6969/announce - < Failed > 
13/20 - Adding tracker udp://tracker.tiny-vps.com:6969/announce - < Failed > 
14/20 - Adding tracker udp://opentor.org:2710/announce - < Failed > 
15/20 - Adding tracker udp://tracker1.bt.moack.co.kr:80/announce - < Failed > 
16/20 - Adding tracker udp://tracker.zerobytes.xyz:1337/announce - < Failed > 
17/20 - Adding tracker udp://tracker.theoks.net:6969/announce - < Failed > 
18/20 - Adding tracker udp://tracker.monitorit4.me:6969/announce - < Failed > 
19/20 - Adding tracker udp://tracker.moeking.me:6969/announce - < Failed > 
20/20 - Adding tracker udp://tracker.loadbt.com:6969/announce - < Failed > 
Done!

Echoing the command in inject_trackers (), it looks like $1 is being not being passed in:

/usr/bin/transmission-remote localhost:9091 -n=REDACTED:REDACTED -t  --tracker-add udp://tracker.opentrackr.org:1337/announce 1>/dev/null 2>&1
...
ragebflame commented 2 years ago

To add to this; It seems to be working okay if I provide a string name. Am I possibly using the Number option incorrectly?

AddTransmissionTrackers.sh                      - list current torrents              WORKING
AddTransmissionTrackers.sh $n1 $n2...   - add trackers to torrent of number $n1 and $n2              FAILING (when I pass an ID e.g. 15)
AddTransmissionTrackers.sh $s1 $s2...   - add trackers to first torrent with part of name $s1 and $s2              WORKING
Jorman commented 2 years ago

Hi, I've to better understand this error, actually I'm not using transmission but I can try to figure out why this happen Just remember that if you try to inject trackers inside one torrent that already have the same trackers, you'll get error but I think you already know that. A very stupid question, do you have torrent number 1? Transmission use progressive numbers for ID but can skip ID, you can check all you available ID simply run ./AddTransmissionTrackers.sh Can you please run this bash -x AddTransmissionTrackers.sh 2 1>/dev/null 2>test.log Remove all information that you don't want to share and post the test.log or upload it somewhere?

ragebflame commented 2 years ago

Sure,

test.log output is on <>

I am aware that an error will be thrown if the tracker already exists. I can see the script working if I pass it a string that a torrent name contains.

Jorman commented 2 years ago

Ok, I can replicate the error, the problem is not the number 1 is all the numbers, only number have problem for now, auto-inject works, name also, but not numbers. I'll try to figure it out

ragebflame commented 2 years ago

Thanks. I'm sure its a small fix, was too lazy to have a look myself!

Very useful script, and I can pass a string value for now.

Jorman commented 2 years ago

Heheheh, I think you can fix it better than me, lol! Yes you can, but is always one error on number side :D

Jorman commented 2 years ago

Hi, try this little fix. When I'll have some time, I'll rewrite the entire logic of manual run, the bast way is to have some little arguments, like -n for number, -t for text and so on

ragebflame commented 2 years ago

Hi, try this little fix. When I'll have some time, I'll rewrite the entire logic of manual run, the bast way is to have some little arguments, like -n for number, -t for text and so on

Thanks, I'll give it a go!