Skip to content

Commit

Permalink
Merge pull request #77 from darkxex/master
Browse files Browse the repository at this point in the history
small changes in in-built keyboard.
  • Loading branch information
darkxex authored Sep 6, 2023
2 parents f860135 + 8320ba4 commit 9666821
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 31 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
"xlocinfo": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xtr1common": "cpp"
"xtr1common": "cpp",
"cstdarg": "cpp",
"mutex": "cpp",
"stop_token": "cpp",
"thread": "cpp"
}
}
1 change: 1 addition & 0 deletions include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@



extern std::string tempKbUrl;

typedef struct {
GLuint id = 0;
Expand Down
29 changes: 11 additions & 18 deletions source/UI/mainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,33 +119,26 @@ 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)
{
namefile = "Streaming from JKAnime...";
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;
Expand Down
2 changes: 1 addition & 1 deletion source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 8 additions & 11 deletions source/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,31 +474,29 @@ 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#","");
std::string ThirdKey = jkObj.scrapeHtml("https://jkanime.net/gsplay/api.php",second,true,"https://jkanime.net/",true);
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;
}


Expand All @@ -523,7 +521,6 @@ bool GetChargeStatue(void) {
return false;
}


std::string KeyboardCall (std::string hint, std::string text){
Result ret = 0;
SwkbdConfig swkbd;
Expand All @@ -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);
Expand Down

0 comments on commit 9666821

Please sign in to comment.