few stuff ...
This commit is contained in:
parent
9bb02920fd
commit
6b586eb283
13
crawl.py
13
crawl.py
|
@ -29,10 +29,8 @@ from yggtorrentscraper import set_yggtorrent_tld
|
|||
set_yggtorrent_tld("se")
|
||||
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 = run(["./lib/scrabash.sh", "search", "--best-true"])
|
||||
|
||||
print(colored(research, 'yellow'))
|
||||
|
||||
try:
|
||||
|
@ -73,6 +71,11 @@ def rollingFiles():
|
|||
def checkDisk():
|
||||
global diskSize
|
||||
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
|
||||
if torrentSize >= diskLimit:
|
||||
print(colored('This torrent is larger as your disk limit:', 'red'))
|
||||
|
@ -105,7 +108,7 @@ def downloadTorrent():
|
|||
scraper.download_from_torrent_url(research)
|
||||
else:
|
||||
print(colored("Login failed", 'red'))
|
||||
|
||||
sys.exit(1)
|
||||
|
||||
# Remove tracker
|
||||
def removeTracker():
|
||||
|
@ -122,4 +125,6 @@ rollingFiles()
|
|||
downloadTorrent()
|
||||
removeTracker()
|
||||
|
||||
# End
|
||||
print(colored("Done", 'green'))
|
||||
sys.exit(0)
|
||||
|
|
12
install.sh
12
install.sh
|
@ -60,11 +60,23 @@ torrengo() {
|
|||
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
|
||||
[[ -z $(which ipfs) ]] && ipfs
|
||||
[[ -z $(which sbotc) ]] && sbotc
|
||||
[[ -z $(which transmission-daemon) ]] && transmission
|
||||
|
||||
$@
|
||||
|
||||
echo -e "Installation Complete"
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
user = ""
|
||||
passwd = ""
|
||||
transUser = ""
|
||||
transPwd = ""
|
||||
|
||||
|
|
Loading…
Reference in New Issue