projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c319d1c
)
[csjw] Make description optional
author
Sergey M․
<dstftw@gmail.com>
Sun, 9 Jul 2017 10:05:11 +0000
(17:05 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 9 Jul 2017 10:05:11 +0000
(17:05 +0700)
youtube_dl/extractor/cjsw.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/cjsw.py
b/youtube_dl/extractor/cjsw.py
index aab6ea535c2ede0b9c6468ad94e21caa1c461487..dd271586f4cfcccc6278d1591e4d86555ae9e40f 100644
(file)
--- a/
youtube_dl/extractor/cjsw.py
+++ b/
youtube_dl/extractor/cjsw.py
@@
-11,7
+11,7
@@
from ..utils import (
class CJSWIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cjsw\.com/program/(?P<program>[^/]+)/episode/(?P<id>\d+)'
class CJSWIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cjsw\.com/program/(?P<program>[^/]+)/episode/(?P<id>\d+)'
- _TEST
=
{
+ _TEST
S = [
{
'url': 'http://cjsw.com/program/freshly-squeezed/episode/20170620',
'md5': 'cee14d40f1e9433632c56e3d14977120',
'info_dict': {
'url': 'http://cjsw.com/program/freshly-squeezed/episode/20170620',
'md5': 'cee14d40f1e9433632c56e3d14977120',
'info_dict': {
@@
-22,7
+22,11
@@
class CJSWIE(InfoExtractor):
'series': 'Freshly Squeezed',
'episode_id': '20170620',
},
'series': 'Freshly Squeezed',
'episode_id': '20170620',
},
- }
+ }, {
+ # no description
+ 'url': 'http://cjsw.com/program/road-pops/episode/20170707/',
+ 'only_matching': True,
+ }]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
@@
-51,7
+55,8
@@
class CJSWIE(InfoExtractor):
}]
description = self._html_search_regex(
}]
description = self._html_search_regex(
- r'<p>(?P<description>.+?)</p>', webpage, 'description', fatal=False)
+ r'<p>(?P<description>.+?)</p>', webpage, 'description',
+ default=None)
series = self._search_regex(
r'data-showname=(["\'])(?P<name>(?:(?!\1).)+)\1', webpage,
'series', default=program, group='name')
series = self._search_regex(
r'data-showname=(["\'])(?P<name>(?:(?!\1).)+)\1', webpage,
'series', default=program, group='name')