File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ def _get_thumbs(data):
4646
4747 return video_thumb
4848
49+ # function that returns only last URL if there are multiple URLs stacked together
50+ def _get_last_url (data ):
51+ regex = re .compile ("(?:.(?!http[s]?://))+$" )
52+ return regex .findall (data )[0 ]
4953
5054def _get_apod_chars (dt , thumbs ):
5155 media_type = 'image'
@@ -83,11 +87,11 @@ def _get_apod_chars(dt, thumbs):
8387 props ['copyright' ] = copyright_text
8488 props ['media_type' ] = media_type
8589 if data :
86- props ['url' ] = data
90+ props ['url' ] = _get_last_url ( data )
8791 props ['date' ] = dt .isoformat ()
8892
8993 if hd_data :
90- props ['hdurl' ] = hd_data
94+ props ['hdurl' ] = _get_last_url ( hd_data )
9195
9296 if thumbs and media_type == "video" :
9397 if thumbs .lower () == "true" :
You can’t perform that action at this time.
0 commit comments