1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-24 03:01:53 +00:00

[cbslocal] Fix timestamp parsing (closes #10213)

This commit is contained in:
Yen Chi Hsuan 2016-08-05 11:44:50 +08:00
parent 7dc2a74e0a
commit 962250f7ea
No known key found for this signature in database
GPG key ID: 3FDDD575826C5C30
2 changed files with 9 additions and 7 deletions

View file

@ -1,3 +1,9 @@
version <unreleased>
Fixed/improved extractors
- [cbslocal] Fix timestamp parsing (#10213)
version 2016.08.01 version 2016.08.01
Fixed/improved extractors Fixed/improved extractors
@ -7,6 +13,7 @@ Fixed/improved extractors
- [safari] Relax regular expressions for URL matching (#10202) - [safari] Relax regular expressions for URL matching (#10202)
- [cwtv] Add support for cwtvpr.com (#10196) - [cwtv] Add support for cwtvpr.com (#10196)
version 2016.07.30 version 2016.07.30
Fixed/improved extractors Fixed/improved extractors

View file

@ -1,12 +1,10 @@
# coding: utf-8 # coding: utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
import calendar
import datetime
from .anvato import AnvatoIE from .anvato import AnvatoIE
from .sendtonews import SendtoNewsIE from .sendtonews import SendtoNewsIE
from ..compat import compat_urlparse from ..compat import compat_urlparse
from ..utils import unified_timestamp
class CBSLocalIE(AnvatoIE): class CBSLocalIE(AnvatoIE):
@ -71,10 +69,7 @@ class CBSLocalIE(AnvatoIE):
time_str = self._html_search_regex( time_str = self._html_search_regex(
r'class="entry-date">([^<]+)<', webpage, 'released date', fatal=False) r'class="entry-date">([^<]+)<', webpage, 'released date', fatal=False)
timestamp = None timestamp = unified_timestamp(time_str)
if time_str:
timestamp = calendar.timegm(datetime.datetime.strptime(
time_str, '%b %d, %Y %I:%M %p').timetuple())
info_dict.update({ info_dict.update({
'display_id': display_id, 'display_id': display_id,