Add FilesLocations to db.py
This commit is contained in:
parent
7e3fec6270
commit
189960d2a6
1
crawl.py
1
crawl.py
|
@ -29,7 +29,6 @@ from yggtorrentscraper import set_yggtorrent_tld
|
||||||
set_yggtorrent_tld("se")
|
set_yggtorrent_tld("se")
|
||||||
name = ' '.join(sys.argv[1:])
|
name = ' '.join(sys.argv[1:])
|
||||||
|
|
||||||
print("ok")
|
|
||||||
# Search torrent 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()
|
||||||
print(colored(research, 'yellow'))
|
print(colored(research, 'yellow'))
|
||||||
|
|
|
@ -32,7 +32,8 @@ get_details() {
|
||||||
Size=$(echo "$result" | grep -w "Size :" | awk -F ": " '{ print $2 }')
|
Size=$(echo "$result" | grep -w "Size :" | awk -F ": " '{ print $2 }')
|
||||||
Uploader=$(echo "$result" | grep -w "Uploader :" | awk -F ": " '{ print $2 }')
|
Uploader=$(echo "$result" | grep -w "Uploader :" | awk -F ": " '{ print $2 }')
|
||||||
Files=$(echo "$result" | grep -w "file_name :" | awk -F ": " '{ print $2 }' | wc -l)
|
Files=$(echo "$result" | grep -w "file_name :" | awk -F ": " '{ print $2 }' | wc -l)
|
||||||
##TODO kopa add FilesLocations
|
FilesNames=$(echo "$result" | grep -w "file_name :" | awk -F ": " '{ print $2 }' | tr -d '"}')
|
||||||
|
FilesLocations="data/files/$FilesNames"
|
||||||
|
|
||||||
if [[ $Size =~ "Go" ]]; then
|
if [[ $Size =~ "Go" ]]; then
|
||||||
Unity="Go"
|
Unity="Go"
|
||||||
|
@ -44,7 +45,7 @@ get_details() {
|
||||||
|
|
||||||
echo "$idTorrent"
|
echo "$idTorrent"
|
||||||
|
|
||||||
echo -e "Name = '$torrentName'\nUrl = '$Url'\nSize = $Size\nUnity = '$Unity'\nID = $idTorrent\nUploader = $Uploader\nFiles = $Files" > db.py
|
echo -e "Name = '$torrentName'\nUrl = '$Url'\nSize = $Size\nUnity = '$Unity'\nID = $idTorrent\nUploader = $Uploader\nFiles = $Files\nFilesLocations = $FilesLocations" > db.py
|
||||||
|
|
||||||
# Get image
|
# Get image
|
||||||
[[ ! -d img ]] && mkdir img && cd img
|
[[ ! -d img ]] && mkdir img && cd img
|
||||||
|
|
Loading…
Reference in New Issue