diff --git a/animeweek/animeweek.js b/animeweek/animeweek.js index d4954da..27fd315 100644 --- a/animeweek/animeweek.js +++ b/animeweek/animeweek.js @@ -93,15 +93,38 @@ async function extractStreamUrl(url) { }; const response = await fetchv2("https://michealcdn.com/player/index.php?data=" + videoId + "&do=getVideo", headers, "POST", postData); const data = await response.json(); - return data.securedLink; + console.log("Fetched video data: " + JSON.stringify(data)); + + const streamUrl = data.securedLink; + return JSON.stringify({ + "streams": [ + { + "title": "Stream 1", + "streamUrl": streamUrl, + "headers": { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", + "Accept": "*/*", + "Accept-Language": "en-US,en;q=0.9", + "Accept-Encoding": "gzip, deflate, br", + "Referer": "https://michealcdn.com/", + "Origin": "https://michealcdn.com", + "Sec-Fetch-Dest": "video", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-origin", + "Range": "bytes=0-" + } + } + ], + "subtitle": "" + }); } catch (err) { console.log("Error fetching video URL:"+ err); } - return "https://error.org/"; + return JSON.stringify({"streams": [{"title": "Error", "streamUrl": "https://error.org/", "headers": {}}], "subtitle": ""}); } - return "https://error.org/"; + return JSON.stringify({"streams": [{"title": "Error", "streamUrl": "https://error.org/", "headers": {}}], "subtitle": ""}); } catch (err) { - return "https://error.org/"; + return JSON.stringify({"streams": [{"title": "Error", "streamUrl": "https://error.org/", "headers": {}}], "subtitle": ""}); } }