few stuff ...

This commit is contained in:
poka 2020-03-22 06:35:11 +01:00
parent 9bb02920fd
commit 6b586eb283
3 changed files with 24 additions and 4 deletions

View File

@ -29,10 +29,8 @@ from yggtorrentscraper import set_yggtorrent_tld
set_yggtorrent_tld("se") set_yggtorrent_tld("se")
name = ' '.join(sys.argv[1:]) name = ' '.join(sys.argv[1:])
#research = os.system("./lib/scrabash.sh search --best=true " + name) # Search torrent name
research = os.popen('./lib/scrabash.sh search --best=true ' + name).read() research = os.popen('./lib/scrabash.sh search --best=true ' + name).read()
#research = run(["./lib/scrabash.sh", "search", "--best-true"])
print(colored(research, 'yellow')) print(colored(research, 'yellow'))
try: try:
@ -73,6 +71,11 @@ def rollingFiles():
def checkDisk(): def checkDisk():
global diskSize global diskSize
diskSize = os.popen('./trans-ctl.sh checkdisk').read() diskSize = os.popen('./trans-ctl.sh checkdisk').read()
if re.search("You have reached", diskSize):
fields = diskSize.strip().split()
if "M" in diskSize:
diskSize = float(fields[-1])
diskEnd = float(diskSize) + torrentSize diskEnd = float(diskSize) + torrentSize
if torrentSize >= diskLimit: if torrentSize >= diskLimit:
print(colored('This torrent is larger as your disk limit:', 'red')) print(colored('This torrent is larger as your disk limit:', 'red'))
@ -105,7 +108,7 @@ def downloadTorrent():
scraper.download_from_torrent_url(research) scraper.download_from_torrent_url(research)
else: else:
print(colored("Login failed", 'red')) print(colored("Login failed", 'red'))
sys.exit(1)
# Remove tracker # Remove tracker
def removeTracker(): def removeTracker():
@ -122,4 +125,6 @@ rollingFiles()
downloadTorrent() downloadTorrent()
removeTracker() removeTracker()
# End
print(colored("Done", 'green')) print(colored("Done", 'green'))
sys.exit(0)

View File

@ -60,11 +60,23 @@ torrengo() {
rm /tmp/go1.13.4.linux-amd64.tar.gz rm /tmp/go1.13.4.linux-amd64.tar.gz
} }
pip3() {
sudo apt install python3-pip
}
iptubes() {
[[ -z $(which pip3) ]] && pip3
/usr/bin/pip3 install $(curl -s https://raw.githubusercontent.com/Harkame/YggTorrentScraper/master/requirements.txt)
}
# Check installs # Check installs
[[ -z $(which ipfs) ]] && ipfs [[ -z $(which ipfs) ]] && ipfs
[[ -z $(which sbotc) ]] && sbotc [[ -z $(which sbotc) ]] && sbotc
[[ -z $(which transmission-daemon) ]] && transmission [[ -z $(which transmission-daemon) ]] && transmission
$@
echo -e "Installation Complete" echo -e "Installation Complete"
exit 0 exit 0

View File

@ -1,2 +1,5 @@
user = "" user = ""
passwd = "" passwd = ""
transUser = ""
transPwd = ""