File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def get_images(self, news):
55
55
for feed in news :
56
56
images = feed .media_content
57
57
for number_of_image , image in enumerate (images ):
58
- if not image :
58
+ if not image or image . endswith ( '.mp4' ) :
59
59
continue
60
60
image = self .check_image_link (image )
61
61
response , content = h .request (image )
@@ -75,6 +75,7 @@ def check_image_link(image_link):
75
75
where_sub_link = image_link .rfind ('http' )
76
76
if where_sub_link :
77
77
return image_link [where_sub_link :]
78
+ return image_link
78
79
79
80
80
81
class HtmlConverter (ConverterBase ):
@@ -181,8 +182,8 @@ def add_description(self, description):
181
182
182
183
def add_images_from_the_feed (self , id , media_content ):
183
184
'''Method that adds images from the news to document'''
184
- for number_of_image in range ( len ( media_content ) ):
185
- if not media_content [ 0 ] :
185
+ for number_of_image , image_link in enumerate ( media_content ):
186
+ if not image_link or image_link . endswith ( '.mp4' ) :
186
187
continue
187
188
self .set_x (50 )
188
189
self .image (path .join (self .dir_with_images , f'{ id } { number_of_image } .png' ), w = 120 , h = 80 )
You can’t perform that action at this time.
0 commit comments