|
|
@ -28,8 +28,8 @@ class YoutubeLiveChatReplayFD(FragmentFD):
|
|
|
|
return self._download_fragment(ctx, url, info_dict, headers)
|
|
|
|
return self._download_fragment(ctx, url, info_dict, headers)
|
|
|
|
|
|
|
|
|
|
|
|
def parse_yt_initial_data(data):
|
|
|
|
def parse_yt_initial_data(data):
|
|
|
|
window_patt = b'window\\["ytInitialData"\\]\\s*=\\s*(.*?);'
|
|
|
|
window_patt = b'window\\["ytInitialData"\\]\\s*=\\s*(.*?)(?<=});'
|
|
|
|
var_patt = b'var\\s+ytInitialData\\s*=\\s*(.*?);'
|
|
|
|
var_patt = b'var\\s+ytInitialData\\s*=\\s*(.*?)(?<=});'
|
|
|
|
for patt in window_patt, var_patt:
|
|
|
|
for patt in window_patt, var_patt:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
raw_json = re.search(patt, data).group(1)
|
|
|
|
raw_json = re.search(patt, data).group(1)
|
|
|
|