File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -175,12 +175,22 @@ def default_mirror(link, filename):
175
175
req = request .Request (link , headers = DownloadBook .headers )
176
176
source = request .urlopen (req )
177
177
soup = BeautifulSoup (source , 'lxml' )
178
+ mother_link = "https://libgen.pw"
178
179
179
180
for a in soup .find_all ('a' ):
180
- if a .text == 'GET' :
181
- download_url = a .attrs ['href' ]
181
+ if a .text == 'Open download' :
182
+ item_url = a .attrs ['href' ]
183
+ getpage_url = mother_link + item_url
184
+ req2 = request .Request (getpage_url , headers = DownloadBook .headers )
185
+ source2 = request .urlopen (req2 )
186
+ soup2 = BeautifulSoup (source2 , 'lxml' )
187
+
188
+ for a in soup2 .find_all ('a' ):
189
+ if a .text == 'Get' :
190
+ download_url = mother_link + a .attrs ['href' ]
182
191
break
183
192
193
+
184
194
if os .path .exists (DOWNLOAD_PATH ) and os .path .isdir (DOWNLOAD_PATH ):
185
195
print ('Downloading...' )
186
196
path = '{}/{}' .format (DOWNLOAD_PATH , filename )
You can’t perform that action at this time.
0 commit comments