GithubHelp home page GithubHelp logo

scripts's People

Contributors

atomicrobotman0101 avatar jorman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scripts's Issues

Fail on qBittorrent-cli. Aborting.

I'm running a Docker container with qBittorrent 4.2.5.
When trying to run the script from Sonarr it exits with code 1.

I used the console to manually run the script from inside the Sonarr container and it says qBittorrent-CLI is missing eventhough your Readme says it is not needed anymore.
When commenting the code below the script seems to work.

if [[ -z $qbt_executable ]]; then
	echo -e "\n\e[0;91;1mFail on qBittorrent-cli. Aborting.\n\e[0m"
	echo "You can find it here: https://github.com/fedarovich/qbittorrent-cli"
	exit 1
fi

AddqBittorrentTrackers.sh won't get torrents list

I don't understand this all well enough to know what dumb mistake I may be making.

qBittorrent 4.2.5 is installed and up and running on Debian sid. jc and curl are installed and AddqBittorrentTrackers.sh is executable. qBittorrent has multiple resumed/active torrents, but all I get is

$ ./AddqBittorrentTrackers.sh
Getting torrents list ...

This script expects one or more parameters
AddqBittorrentTrackers.sh 		- list current torrents 
AddqBittorrentTrackers.sh $s1 $s2...	- add trackers to first torrent with part of name $s1 and $s2
AddqBittorrentTrackers.sh .		- add trackers to all torrents
Names are case insensitive 

Current torrents:
$ 

qBittorrent is set to Use a different port on each startup. AddqBittorrentTrackers.sh's ########## CONFIGURATIONS ########## section has no username or password variables to set, I have no private trackers to list, and host is set to http://localhost and port is the port I see in the qBittorrent Execution Log next to "Embedded Tracker" right after launch. Is that the wrong port to use?

Thanks

Step by step failure

This my first post sorry if its - messed up.

I loaded and edited the configuration file for qbitorrent.

########## CONFIGURATIONS ##########

Host on which qBittorrent runs

qbt_host="http://localhost"

Port -> the same port that is inside qBittorrent option -> Web UI -> Web User Interface

qbt_port="X123"

Username to access to Web UI

qbt_username="user"

Password to access to Web UI

qbt_password="passwd"

If true (lowercase) the script will inject trackers inside private torrent too (not a good idea)

ignore_private=false

Configure here your trackers list

declare -a live_trackers_list_urls=(
"https://newtrackon.com/api/stable"
"https://trackerslist.com/best.txt"
"https://trackerslist.com/http.txt"
"https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt"
)

I changed the qbt variables from their proper values. 
This configuration results in error: 
$ sh ./AddqBittorrentTrackers.sh 
./AddqBittorrentTrackers.sh: 17: Syntax error: "(" unexpected

I removed the "(" and ")" to fix the error. And ran again.
Resulting Error:

$ sh ./AddqBittorrentTrackers.sh
./AddqBittorrentTrackers.sh: 17: declare: not found
./AddqBittorrentTrackers.sh: 18: https://newtrackon.com/api/stable: not found
./AddqBittorrentTrackers.sh: 19: https://trackerslist.com/best.txt: not found
./AddqBittorrentTrackers.sh: 20: https://trackerslist.com/http.txt: not found
./AddqBittorrentTrackers.sh: 21: https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt: not found
./AddqBittorrentTrackers.sh: 32: [[: not found
./AddqBittorrentTrackers.sh: 39: [[: not found
./AddqBittorrentTrackers.sh: 140: Syntax error: redirection unexpected

 I havent been able to get past this. 




Improved Readme Instructions

I'm following the steps for getting this working through Radarr/Sonarr and it'd be really great to include some steps to know if it worked or not. And if it didn't work, some troubleshooting for common problems would be great. Screenshots are always worth 1000 words.

So for me, I think I set it up right and I manually ran it via my Windows Powershell and there weren't any errors. However, I go to my qbittorrent and check the trackers and it's hard to tell if they were added. They definitely were not added to queued up torrents. I added some best trackers to the currently downloading torrents, but I imagine there are supposed to be a lot more trackers. I'm not sure it's working or what to do about it. Thanks.

AddTransmissionTrackers.sh failing to add trackers

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
...

AddqBittorrentTrackers, jq error on Qnap NAS

I'm getting this error when trying to run with -n

[~] # /share/Download/AddqBittorrentTrackers.sh -n Pulp
jq: error (at <stdin>:1): jq was compiled without ONIGURUMA regex libary. match/test/sub and related functions are not available.
I didn't find a torrent with the text: 
No torrents found, exiting

I can use "-a" , also "-l" shows torrents lists, but jq gives error on entware with "-n":

[~] # opkg list | grep jq
jq - 1.6-2 - Lightweight and flexible command-line JSON processor.
[~] # which jq
/opt/bin/jq

Add Readarr support

To validate script execution (and pass test event without exit code 1) in Readarr - line 263 in AddqBittorrentTrackers.sh (or 163 in AddTransmissionTrackers.sh) must be changed to

if [[ $sonarr_eventtype == "Test" ]] || [[ $radarr_eventtype == "Test" ]] || [[ $lidarr_eventtype == "Test" ]] || [[ $readarr_eventtype == "Test" ]]; then

After that, everything work as expected.

AddqBittorrentTrackers.sh for Lidarr ?

If I try to add it to custom scripts like in radarr/sonarr it just says "Script exited with code: 1" when I press test so I can not save it.
Any way to add it in Lidarr?

Trackers aren't added via Sonarr/Radarr on Transmission

hi @Jorman and thank you for the great script!

I followed the instructions and can make it work when run manually (with -a), but it seems the script is not being handled correctly by sonarr 4.0.0.733 and radarr 5.2.3.8303 on Transmission 4.0.4, as no trackers are added to new torrents on grab.

Is there a way to help you debug this and see what's going on?

Request: remove old trackers

Heya,

Is there an option to make the script clear the current trackers the torrent has before adding the fresh list?

multiple trackers list?

hello,

how can i add multiple live_trackers_list_url?
is it possible?

thanks for the script.

example private_tracker_list

Haven't been able to figure out how to use private_tracker_list

have tried (pulled from transmissions trackers list for the item) (tracker name was changed for this example though):
private_tracker_list='https://tracker.myprivatetracker.com:443'
and private_tracker_list='https://tracker.myprivatetracker.com:443/announce'

but keep getting:
Private tracker list present, checking if the torrent is private
The torrent is not private, I'll inject trackers on it

is there something obvious I'm missing here? And how would you add multiple private trackers to this list (comma, space or newline separate)?

AddqBittorrentTracker.sh on Synology

Regarding AddqBittorrentTrackers.sh at this line
Synology DSM 7 doesn’t have the “rev” command. So I replaced:
| tail -n +4 | tr '\n' '|' | rev | cut -c2- | rev)

With:

| tail -n +4 | tr '\n' '|' | grep -o . | tac | tr -d '\n' | cut -c2- | grep -o . | tac | tr -d '\n')

This seems to work for me. I am not skilled in programming. Just used my Google Foo to find this option.

All trackers get added to tier 0 with AddqBittorrentTrackers

qBittorrent 4.5.3 on Windows 10
AddqBittorrentTrackers runs on Ubuntu 22.04

When AddqBittorrentTrackers runs it adds all the trackers without an empty line between them. qBittorrent (and I believe other clients) treat that as 1 tracker that has multiple URLs (tiers). By default the second tracker URL only gets checked when the first tracker URL is unavailable, which means that if the first tracker works, but has no seeders or leechers, and the second tracker does, you can never get those seeders or leechers.
You can enable announce_to_all_trackers to get around this by having qBittorrent always announce to all trackers in 1 tier (since all our trackers are now in tier 0), but by default that is disabled.

I tried adding a line break to the cURL command on line 131, but I couldn't get that to work. I don't know if I did that wrong, or if the API trims the tracker URL it gets.

AddqBittorrentTrackers.sh curl errors

Manually trying to test this script before using it in Radarr.

Running it using the IP docker provides the container and passing the -a flag leads to a curl error.

Output shows:

ubuntu@main:/data$ ./trackers.sh -a
curl: (22) The requested URL returned error: 401
curl: (22) The requested URL returned error: 403
No torrents found, exiting

Running it with the -l flag makes me believe it's a qBittorrent issue.

ubuntu@main:/data$ ./trackers.sh -l
curl: (22) The requested URL returned error: 401

Current torrents:
movie1.mkv
ubuntu@main:/data$

I'm using the original tracker links provided in the script and manually changed the backup trackers but nothing other than that. chown and chmod have both been run appropriately, thanks.

Run from qBittorrent directly

Hi,

Thanks for your work, works well from Radarr etcetera.

Question though, there is also an option inside qBittorrent to execute a script when a torrent is added.
(Under Options -> Downloads -> Run External Program)
Now I've tried adding the script there, with the -n argument and %N (Torrent name), however this does not seem to work.
In the logs I see script is executed but no trackers are added.

It looks like this now:

/path/to/script/AddqBittorrentTrackers.sh -n "%N"

I'm running qBittorrent via docker container on Linux by the way.
When I see the log, it does say execute command /path/to/script/AddqBittorrentTrackers.sh -n "TORRENT NAME",
but nothing happens.
When I bash inside the docker container and copy-paste the command, it does work.
Now I'm wondering if it is maybe the -n argument which is preventing it from working, but this is just a wild guess.

I have also tried to put it like this:
/path/to/script/AddqBittorrentTrackers.sh -a
But this also does not work.

Would it be possible to check from your side if this can be debugged?
I would be more than happy to help of course!

Qnap bad substitution

if [[ "${qbt_host,,}" == *"https"* ]] ;then

Qnap gives error on this argument:

bash  AddqBittorrentTrackers.sh -h
AddqBittorrentTrackers.sh: line 49: ${qbt_host,,}: bad substitution

May be change it to this simpler one

if [[ $qbt_host == "https://"* ]]; then

hash_check: command not found

Both Sonarr and Radarr are throwing errors on these lines
the hash_check isn't something sonarr / radarr understands in Debian 11 and I cant find where it was defined in the script.
Running it manual and not as a radarr / sonarr connect script doesn't cause issues.

AddTransmissionTrackers.sh: line 174: hash_check: command not found

  hash_check "${hash}"
  if [[ $? -ne 0 ]]; then
    echo "The download is not for a torrent client, I'll exit"
    exit
  fi

This command is caused by a pipe issue i believe but also cant figure out how to fix the code

line 153: wait: pid 5 is not a child of this shell

if [[ -n "${sonarr_download_id}" ]] || [[ -n "${radarr_download_id}" ]] || [[ -n "${lidarr_download_id}" ]] || [[ -n "${readarr_download_id}" ]]; then wait 5

Maybe you can provide some insight.
The script still seems to run and do it's required purpose.

Thanks

  • Info
  • Radarr Version
  • 4.0.4.5922
  • .NET
  • Yes (6.0.1)
  • Sonarr Version
  • 3.0.6.1460
  • Mono Version
  • 6.8.0.105

Simplification of the "unique trackers" logic

This line looks convoluted:

trackers_list=$(echo "$tmp_trackers_list" | awk '{for (i=1;i<=NF;i++) if (!a[$i]++) printf("%s%s",$i,FS)}{printf("\n")}' | xargs | tr ' ' '\n')

How about simplifying it?

Do we care about the initial order of the list? If we don't care, we can just use:

	trackers_list=$(echo "$tmp_trackers_list" | tr ' ' '\n' | sort | uniq)
	# Alternative version that may not work on certain systems:
	trackers_list=$(echo "$tmp_trackers_list" | tr ' ' '\n' | sort -u)

If we care about the initial order:

	trackers_list=$(echo "$tmp_trackers_list" | tr ' ' '\n' | awk '{if ($0 && !a[$0]++) print($0)}')

We can even make it print an additional newline, in case that helps with #18:

	trackers_list=$(echo "$tmp_trackers_list" | tr ' ' '\n' | awk '{if ($0 && !a[$0]++) print($0 "\n")}')

String concatenation in awk is accomplished by just putting strings next to each other, no operator needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.