File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export default {
15
15
"https://www.facebook.com/groups/j2team.community/posts/974953859503401/" ,
16
16
17
17
changeLogs : {
18
+ "2024-08-14" : "get video url directly" ,
18
19
"2024-07-25" : "add backup plan" ,
19
20
} ,
20
21
@@ -63,13 +64,14 @@ export default {
63
64
} ,
64
65
contentScript : {
65
66
onClick_ : async ( ) => {
67
+ const { openPopupWithHtml } = await import ( "./helpers/utils.js" ) ;
68
+
66
69
let url = new URL ( location . href ) ;
67
70
const player_response = url . searchParams . get ( "player_response" ) ;
68
71
if ( player_response ) {
69
72
const json = JSON . parse ( player_response ) ;
70
73
console . log ( document . title , json ) ;
71
74
72
- const { openPopupWithHtml } = await import ( "./helpers/utils.js" ) ;
73
75
openPopupWithHtml (
74
76
`<h1>${ document . title } </h1>
75
77
${ json . streamingData . formats
@@ -83,6 +85,23 @@ export default {
83
85
700 ,
84
86
700
85
87
) ;
88
+ } else {
89
+ const videos = document . querySelectorAll ( "video" ) ;
90
+ if ( videos . length ) {
91
+ openPopupWithHtml (
92
+ `<h1>${ document . title } </h1>
93
+ ${ Array . from ( videos )
94
+ . map ( ( _ ) => {
95
+ return /*html*/ `<div>
96
+ <h1><a href="${ _ . src } " target="_blank">Link</a></h1>
97
+ <video src="${ _ . src } " controls style="max-width:95%" />
98
+ </div>` ;
99
+ } )
100
+ . join ( "<br/>" ) } `,
101
+ 700 ,
102
+ 700
103
+ ) ;
104
+ }
86
105
}
87
106
} ,
88
107
} ,
You can’t perform that action at this time.
0 commit comments