diff --git a/.vscode/settings.json b/.vscode/settings.json index 4cfe7c8..c41d33a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -64,6 +64,10 @@ "xlocinfo": "cpp", "xmemory": "cpp", "xstddef": "cpp", - "xtr1common": "cpp" + "xtr1common": "cpp", + "cstdarg": "cpp", + "mutex": "cpp", + "stop_token": "cpp", + "thread": "cpp" } } \ No newline at end of file diff --git a/include/utils.h b/include/utils.h index a5d1d69..11cef3f 100644 --- a/include/utils.h +++ b/include/utils.h @@ -25,6 +25,7 @@ +extern std::string tempKbUrl; typedef struct { GLuint id = 0; diff --git a/source/UI/mainMenu.cpp b/source/UI/mainMenu.cpp index 8037903..1705e09 100644 --- a/source/UI/mainMenu.cpp +++ b/source/UI/mainMenu.cpp @@ -119,10 +119,19 @@ namespace Windows { tempKbUrl = received; curlDownloader Scraper; - + if (!received.compare("debug")) + { + } + + if (received.find("https://jk/") != std::string::npos) + { + Utility::replace(received,"https://jk/","https://jkanime.net/"); + + } if (received.find("https://bit.ly/") != std::string::npos) {//if the response from the address does not arrive within 5 seconds, it sends the direct link. - received = Scraper.getRedirection(received,"",false,"",false);} + received = Scraper.getRedirection(received,"",false,"",false); + } if (received.find("https://jkanime.net/") != std::string::npos) { @@ -130,22 +139,6 @@ namespace Windows { received = Utility::Nozomi_Link(received); } - if (received.find("https://www.fembed.com/v/") != std::string::npos || received.find("https://embedsito.com/v/") != std::string::npos || received.find("https://suzihaza.com/v/") != std::string::npos) - { - namefile = "Streaming from Fembed..."; - - Utility::replace(received,"https://suzihaza.com/v/","https://www.fembed.com/api/source/"); - Utility::replace(received,"https://www.fembed.com/v/","https://www.fembed.com/api/source/"); - Utility::replace(received,"https://embedsito.com/v/","https://www.fembed.com/api/source/"); - std::string htmlcode = Scraper.scrapeHtml(received, "", true, "", false); - - int tempValue1 = htmlcode.rfind("https:"); - int tempValue2 = htmlcode.find("\"",tempValue1); - received = htmlcode.substr(tempValue1,tempValue2 - tempValue1); - Utility::replace(received,"\\/","/"); - std::cout << received << std::endl; - } - if(received.find("http") != std::string::npos) { std::cout << "This: "<< received.c_str() << std::endl; diff --git a/source/main.cpp b/source/main.cpp index b762060..e5041f2 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -102,7 +102,7 @@ float multiplyRes = 1.0f; float initScale = 1.0f; int initSize = 55; int batteryPercent = 0; -std::string tempKbUrl = ""; +std::string tempKbUrl = "https://"; shaderMania* shadermania = nullptr; float currFontsize = 20.0f; diff --git a/source/utils.cpp b/source/utils.cpp index 3eab7f5..552952c 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -474,21 +474,19 @@ namespace Utility{ std::string Nozomi_Link(std::string Link){ curlDownloader jkObj; std::string jklink = jkObj.scrapeHtml(Link,"",false,"https://jkanime.net/",true); - Link = scrapElement(jklink,"https://jkanime.net/jkfembed.php?u=", "\""); - replace(Link,"https://jkanime.net/jkfembed.php?u=","https://embedsito.com/v/"); - return Link; - /*Link = scrapElement(jklink,"https://jkanime.net/um2.php?", "\""); + Link = "https://jkanime.net/" + scrapElement(jklink,"um2.php?", "\""); + std::cout << "Secondkey: "<< Link << std::endl; std::string codetemp; //Get FirstKey std::string FirstKey = jkObj.scrapeHtml(Link,"",false,"https://jkanime.net/",true); codetemp = scrapElement(FirstKey,"name=\"data\" value=\"", "\""); replace(codetemp,"name=\"data\" value=\"",""); FirstKey = codetemp; - //std::cout << "FirstKey: "<< FirstKey << std::endl; + std::cout << "FirstKey: "<< FirstKey << std::endl; //Get SecondKey std::string data = "data=" + FirstKey; std::string SecondKey = jkObj.getRedirection("https://jkanime.net/gsplay/redirect_post.php",data,true,"https://jkanime.net/",true); - //std::cout << "Secondkey: "<< SecondKey << std::endl; + std::cout << "Secondkey: "<< SecondKey << std::endl; //Get ThirdKey std::string second = "v=" + SecondKey; replace(second,"https://jkanime.net/gsplay/player.html#",""); @@ -496,9 +494,9 @@ std::string Nozomi_Link(std::string Link){ codetemp = scrapElement(ThirdKey,"https:", "\""); replace(codetemp,"\\",""); ThirdKey = codetemp; - //std::cout << "ThirdKey: "<< ThirdKey << std::endl; + std::cout << "ThirdKey: "<< ThirdKey << std::endl; //return URL - return ThirdKey;*/ + return ThirdKey; } @@ -523,7 +521,6 @@ bool GetChargeStatue(void) { return false; } - std::string KeyboardCall (std::string hint, std::string text){ Result ret = 0; SwkbdConfig swkbd; @@ -535,8 +532,8 @@ std::string KeyboardCall (std::string hint, std::string text){ } swkbdConfigMakePresetDefault(&swkbd); - swkbdConfigSetInitialCursorPos (&swkbd, 0); - swkbdConfigSetOkButtonText(&swkbd,"Buscar"); + swkbdConfigSetInitialCursorPos (&swkbd, 1); + swkbdConfigSetOkButtonText(&swkbd,"Search"); swkbdConfigSetHeaderText(&swkbd, "NXMP Stream URL"); swkbdConfigSetSubText(&swkbd, hint.c_str()); swkbdConfigSetStringLenMax(&swkbd, 512);