add data folder

This commit is contained in:
poka 2020-03-20 03:02:03 +01:00
parent e31e1f2549
commit e36940e4d5
3 changed files with 5 additions and 4 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
data/files/*
data/torrents/*
__pycache__/
ygg-crawler/node_modules/
yggcrawl/__pycache__/
login.py

0
data/torrents/.gitkeep Normal file
View File

View File

@ -330,7 +330,7 @@ class YggTorrentScraper:
return torrents
#kopa
def download_from_torrent_url(self, torrent_url=None, destination_path="./data/files/"):
def download_from_torrent_url(self, torrent_url=None, destination_path="./data/torrents/"):
if torrent_url is not None:
torrent = self.extract_details(torrent_url)
@ -338,14 +338,14 @@ class YggTorrentScraper:
torrent_url=torrent.url, destination_path=destination_path
)
def download_from_torrent(self, torrent=None, destination_path="./data/files/"):
def download_from_torrent(self, torrent=None, destination_path="./data/torrents/"):
if torrent is not None:
return self.download_from_torrent_download_url(
torrent_url=torrent.url, destination_path=destination_path
)
def download_from_torrent_download_url(
self, torrent_url=None, destination_path="./data/files/"
self, torrent_url=None, destination_path="./data/torrents/"
):
if torrent_url is None:
raise Exception("Invalid torrent_url, make sure you are logged")