Skip to content
GitLab
Explore
Sign in
Commits on Source (3)
Fix crashes when no permission to download a chapter yet
· 3f59c9eb
Hermann Krumrey
authored
Oct 28, 2019
3f59c9eb
Fix crashes when no permission to download a chapter yet
· c613c467
Hermann Krumrey
authored
Oct 28, 2019
c613c467
Merge branch 'develop' into 'master'
· 29a7a0ee
Hermann Krumrey
authored
Oct 28, 2019
Develop See merge request namibsun/python/manga-dl!3
29a7a0ee
Show whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
29a7a0ee
V 0.3.1:
- Fixes the program crashing when attempting to download chapters that aren't available yet
V 0.3.0:
- Various fixes to the mechanism that bundles chapters
V 0.2.0:
...
...
manga_dl/entities/Chapter.py
View file @
29a7a0ee
...
...
@@ -21,11 +21,11 @@ import os
import
shutil
import
logging
import
cfscrape
import
requests
from
puffotter.os
import
makedirs
from
typing
import
Callable
,
List
from
typing
import
Optional
from
subprocess
import
Popen
,
DEVNULL
from
urllib.request
import
urlretrieve
class
Chapter
:
...
...
@@ -207,9 +207,21 @@ class Chapter:
with
open
(
image_file
,
"
wb
"
)
as
f
:
f
.
write
(
content
)
else
:
urlretrieve
(
image_url
,
image_file
)
resp
=
requests
.
get
(
image_url
,
headers
=
{
"
User-Agent
"
:
"
Mozilla/5.0
"
}
)
if
resp
.
status_code
>=
300
:
self
.
logger
.
warning
(
"
Couldn
'
t download image file {}
"
.
format
(
image_file
))
else
:
with
open
(
image_file
,
"
wb
"
)
as
f
:
f
.
write
(
resp
.
content
)
downloaded
.
append
(
image_file
)
if
len
(
downloaded
)
==
0
:
self
.
logger
.
warning
(
"
Couldn
'
t download chapter {}
"
.
format
(
self
))
else
:
if
_format
in
[
"
cbz
"
,
"
zip
"
]:
self
.
logger
.
debug
(
"
Zipping Files
"
)
Popen
([
"
zip
"
,
"
-j
"
,
dest_path
]
+
downloaded
,
...
...
version
View file @
29a7a0ee
0.3.0
\ No newline at end of file
0.3.1
\ No newline at end of file