]> jfr.im git - yt-dlp.git/blobdiff - youtube_dlc/extractor/ccma.py
Update to ytdl-commit-cf2dbec
[yt-dlp.git] / youtube_dlc / extractor / ccma.py
index 4db51e650680812573e7c3179fb7a1f046764c2a..e6ae49352132f81b1afbced0d71fe35c668c29f0 100644 (file)
@@ -1,12 +1,14 @@
 # coding: utf-8
 from __future__ import unicode_literals
 
+import calendar
 import datetime
 import re
 
 from .common import InfoExtractor
 from ..utils import (
     clean_html,
+    extract_timezone,
     int_or_none,
     parse_duration,
     parse_resolution,
@@ -97,8 +99,9 @@ def _real_extract(self, url):
         timestamp = None
         data_utc = try_get(informacio, lambda x: x['data_emissio']['utc'])
         try:
-            timestamp = datetime.datetime.strptime(
-                data_utc, '%Y-%d-%mT%H:%M:%S%z').timestamp()
+            timezone, data_utc = extract_timezone(data_utc)
+            timestamp = calendar.timegm((datetime.datetime.strptime(
+                data_utc, '%Y-%d-%mT%H:%M:%S') - timezone).timetuple())
         except TypeError:
             pass