Skip to content

Commit

Permalink
dosya dizinleri cross platform edildi, fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
KebabLord committed Jan 16, 2021
1 parent 594c193 commit 6050d42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions turkanime.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def at_exit(): # Program kapatıldığında
elif "Ayarlar" in islem:
parser = ConfigParser()
while True:
parser.read("./config.ini")
parser.read(path.join(".","config.ini"))
isAutosave = parser.getboolean("TurkAnime","izlerken kaydet")
dlFolder = parser.get("TurkAnime","indirilenler")
opsiyon = prompt([{
Expand All @@ -86,9 +86,9 @@ def at_exit(): # Program kapatıldığında
from easygui import diropenbox
parser.set('TurkAnime','indirilenler',diropenbox())
elif opsiyon == f'İzlerken kaydet: {isAutosave}':
parser.set('TurkAnime','izlerken kaydet',str(not isAutosave ))
if path.isdir('./Kayıtlar'):
mkdir("./Kayıtlar")
parser.set('TurkAnime','izlerken kaydet',str(not isAutosave))
if path.isdir(path.join(".","Kayıtlar")):
mkdir(path.join(".","Kayıtlar"))
else:
break

Expand Down
12 changes: 6 additions & 6 deletions turkanime_api/anime.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,31 @@ def __init__(self,driver,seri,bolumler):

def indir(self):
parser = ConfigParser()
parser.read("./config.ini")
parser.read(path.join(".","config.ini"))
dlfolder = parser.get("TurkAnime","indirilenler")

if not path.isdir(f"{dlfolder}/{self.seri}"):
mkdir(f"{dlfolder}/{self.seri}")
if not path.isdir(path.join(dlfolder,self.seri)):
mkdir(path.join(dlfolder,self.seri))

for bolum in self.bolumler:
print(" "*50+"\rBölüm getiriliyor..",end="\r")
self.driver.get(f"https://turkanime.net/video/{bolum}")
print(" "*50+f"\r\n{self.driver.title} indiriliyor:")
url = url_getir(self.driver)
suffix="--referer https://video.sibnet.ru/" if "sibnet" in url else ""
system(f'youtube-dl --no-warnings -o "{dlfolder}/{self.seri}/{bolum}.%(ext)s" "{url}" {suffix}')
system(f'youtube-dl --no-warnings -o "{path.join(dlfolder,self.seri,bolum)}.%(ext)s" "{url}" {suffix}')
return True

def oynat(self):
self.driver.get(f"https://turkanime.net/video/{self.bolumler}")
url = url_getir(self.driver)

parser = ConfigParser()
parser.read("./config.ini")
parser.read(path.join(".","config.ini"))

suffix ="--referrer https://video.sibnet.ru/ " if "sibnet" in url else ""
suffix+= "--msg-level=display-tags=no:cplayer=error "
suffix+=f"--record-file=./Kayıtlar/{self.bolumler} " if parser.getboolean("TurkAnime","izlerken kaydet") else ""
suffix+="--record-file={} ".format(path.join(".","Kayıtlar",self.bolumler)) if parser.getboolean("TurkAnime","izlerken kaydet") else ""

system(f'mpv "{url}" {suffix} ')
return True

0 comments on commit 6050d42

Please sign in to comment.