Skip to content

Commit

Permalink
v0.3c
Browse files Browse the repository at this point in the history
  • Loading branch information
ttop32 committed Dec 12, 2020
1 parent 5171a83 commit fb6fd04
Show file tree
Hide file tree
Showing 99 changed files with 80 additions and 8,741 deletions.
40 changes: 21 additions & 19 deletions src/download_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ def getLocalDirFileList(self,path):

def checkExCred(self,url):
if "exhentai" in url:
if not os.path.exists("lib_/gallery-dl.conf"):
p = subprocess.Popen(("lib_/gallery-dl-cookie/cookie_handler/cookie_handler.exe"))
p.wait()

p = subprocess.Popen(("lib_/gallery-dl-cookie/cookie_handler.exe"))
p.wait()

def updateDownloader(self,):
print("updateDownloader")
#get download link
versionPath='./lib_/gallery-dl.txt'
exePath='./lib_/gallery-dl.exe'


#check latest version
webpage=requests.get("https://github.com/mikf/gallery-dl/releases/")
soup=BeautifulSoup(webpage.content,"html.parser")
mydivs = soup.findAll("div", {"class": "Box Box--condensed mt-3"})[0] #first continaer
Expand All @@ -49,18 +51,18 @@ def updateDownloader(self,):
downloadLink="https://github.com"+a['href']


#check current version
if os.path.exists('./lib_/gallery-dl.txt'):
with open('./lib_/gallery-dl.txt', "r") as file:
#check current holded version
currentVersion=""
if os.path.exists(versionPath):
with open(versionPath, "r") as file:
currentVersion = file.readline()

#download if new version available
if currentVersion!=downloadLink or not os.path.exists(exePath):
print("updateDownloader")
with open(versionPath, "w") as file:
file.write(downloadLink)

#download if new version available
if currentVersion!=downloadLink:
if os.path.exists(downloadLink):
os.remove(downloadLink)
wget.download(downloadLink, './lib_/gallery-dl.exe')

with open('./lib_/gallery-dl.txt', "w") as file:
file.write(downloadLink)


if os.path.exists(exePath):
os.remove(exePath)
wget.download(downloadLink, exePath)
2 changes: 1 addition & 1 deletion src/folder_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def saveFileAndRemove(self,mangaName):

namePadding=""
i=0
if os.path.exists(os.path.join(self.get_download_path(),mangaName+namePadding+".zip")):
while os.path.exists(os.path.join(self.get_download_path(),mangaName+namePadding+".zip")):
i+=1
namePadding="("+str(i)+")"

Expand Down
Binary file added src/lib_/gallery-dl-cookie/cookie_handler.exe
Binary file not shown.
15 changes: 9 additions & 6 deletions src/lib_/gallery-dl-cookie/cookie_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ def main():
cookies_dict=requests.utils.dict_from_cookiejar(cookies)
print(cookies_dict)
confPath='./lib_/gallery-dl.conf'
if os.path.exists(confPath):
with open(confPath) as f:
json_object = json.load(f)
json_object["extractor"]["exhentai"]={"cookie":cookies_dict}
else:
json_object={"extractor":{"exhentai":{"cookies":cookies_dict}}}
isIdExist="ipb_member_id" in cookies_dict.keys() and "ipb_pass_hash" in cookies_dict.keys()

if isIdExist:
if os.path.exists(confPath):
with open(confPath) as f:
json_object = json.load(f)
json_object["extractor"]["exhentai"]={"cookies":cookies_dict}
else:
json_object={"extractor":{"exhentai":{"cookies":cookies_dict}}}


with open(confPath, 'w') as f:
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4,325 changes: 0 additions & 4,325 deletions src/lib_/gallery-dl-cookie/cookie_handler/certifi/cacert.pem

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions src/lib_/gallery-dl-cookie/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
altgraph==0.17
browser-cookie3==0.11.4
certifi==2020.12.5
chardet==3.0.4
future==0.18.2
idna==2.10
importlib-metadata==3.1.1
keyring==21.5.0
lz4==3.1.1
pbkdf2==1.3
pefile==2019.4.18
pyaes==1.6.1
pycryptodome==3.9.9
pyinstaller==4.1
pyinstaller-hooks-contrib==2020.10
pywin32-ctypes==0.2.0
requests==2.25.0
urllib3==1.26.2
wincertstore==0.2
zipp==3.4.0
Binary file not shown.
15 changes: 9 additions & 6 deletions src/pyinstaller/data/lib_/gallery-dl-cookie/cookie_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ def main():
cookies_dict=requests.utils.dict_from_cookiejar(cookies)
print(cookies_dict)
confPath='./lib_/gallery-dl.conf'
if os.path.exists(confPath):
with open(confPath) as f:
json_object = json.load(f)
json_object["extractor"]["exhentai"]={"cookie":cookies_dict}
else:
json_object={"extractor":{"exhentai":{"cookies":cookies_dict}}}
isIdExist="ipb_member_id" in cookies_dict.keys() and "ipb_pass_hash" in cookies_dict.keys()

if isIdExist:
if os.path.exists(confPath):
with open(confPath) as f:
json_object = json.load(f)
json_object["extractor"]["exhentai"]={"cookies":cookies_dict}
else:
json_object={"extractor":{"exhentai":{"cookies":cookies_dict}}}


with open(confPath, 'w') as f:
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit fb6fd04

Please sign in to comment.