projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4c237ab
)
[extractor/common] Add validation for JSON-LD URLs
author
Sergey M․
<dstftw@gmail.com>
Sun, 28 Oct 2018 17:19:08 +0000
(
00:19
+0700)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 28 Oct 2018 17:21:45 +0000
(
00:21
+0700)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index 2dbf81e6e27dc858eb038dffae8a8085f0e61eb6..8452125c8802b1398698c334084c85b673e80964 100644
(file)
--- a/
youtube_dl/extractor/common.py
+++ b/
youtube_dl/extractor/common.py
@@
-69,6
+69,7
@@
from ..utils import (
update_url_query,
urljoin,
url_basename,
update_url_query,
urljoin,
url_basename,
+ url_or_none,
xpath_element,
xpath_text,
xpath_with_ns,
xpath_element,
xpath_text,
xpath_with_ns,
@@
-1213,10
+1214,10
@@
class InfoExtractor(object):
def extract_video_object(e):
assert e['@type'] == 'VideoObject'
info.update({
def extract_video_object(e):
assert e['@type'] == 'VideoObject'
info.update({
- 'url':
e.get('contentUrl'
),
+ 'url':
url_or_none(e.get('contentUrl')
),
'title': unescapeHTML(e.get('name')),
'description': unescapeHTML(e.get('description')),
'title': unescapeHTML(e.get('name')),
'description': unescapeHTML(e.get('description')),
- 'thumbnail':
e.get('thumbnailUrl') or e.get('thumbnailURL'
),
+ 'thumbnail':
url_or_none(e.get('thumbnailUrl') or e.get('thumbnailURL')
),
'duration': parse_duration(e.get('duration')),
'timestamp': unified_timestamp(e.get('uploadDate')),
'filesize': float_or_none(e.get('contentSize')),
'duration': parse_duration(e.get('duration')),
'timestamp': unified_timestamp(e.get('uploadDate')),
'filesize': float_or_none(e.get('contentSize')),