from __future__ import unicode_literals
import base64
+import datetime
import hashlib
import json
import netrc
self._sort_formats(formats)
return formats
+ def _live_title(self, name):
+ """ Generate the title for a live video """
+ now = datetime.datetime.now()
+ now_str = now.strftime("%Y-%m-%d %H:%M")
+ return name + ' ' + now_str
+
class SearchInfoExtractor(InfoExtractor):
"""
# coding: utf-8
from __future__ import unicode_literals
-import datetime
import json
from .common import InfoExtractor
display_id = 'live'
webpage = self._download_webpage(url, display_id)
- now = datetime.datetime.now()
- now_str = now.strftime("%Y-%m-%d %H:%M")
- title = self._og_search_title(webpage) + ' ' + now_str
+ title = self._live_title(self._og_search_title(webpage))
data_js = self._search_regex(
r'(?s)\nplaylist:\s*(\[.*?}\]),related:',