Skip to content

Commit efabe09

Browse files
committed
fix(youtube): fix fetching youtube subscriptions
1 parent 0a01445 commit efabe09

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

background/sources/videos/youtube.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ export default {
6868
data: { 'flow': 2 },
6969
responseType: 'text',
7070
});
71-
const key = 'window["ytInitialData"] = ';
71+
const key = 'window["ytInitialData"] = JSON.parse("';
7272
let response = body;
7373
response = response.slice(response.indexOf(key) + key.length);
74-
response = response.slice(0, response.indexOf('}}};') + 3);
74+
response = response.slice(0, response.indexOf('");\n'));
75+
response = response.replace(/\\([\\"])/g, '$1');
7576
try {
7677
response = JSON.parse(response);
7778
} catch (err) {

0 commit comments

Comments
 (0)