From b35c04e7c8e1b7e639651f8c9f9d1767d4255b67 Mon Sep 17 00:00:00 2001 From: darkxex Date: Sat, 24 Jun 2017 15:49:56 -0400 Subject: [PATCH] Updated AnimeFLV. --- source/main.cpp | 269 ++++++++++++++++++++++++------------------------ 1 file changed, 135 insertions(+), 134 deletions(-) diff --git a/source/main.cpp b/source/main.cpp index 0970088..29e92ab 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -3,10 +3,10 @@ #include #include #include -#include <3ds.h> -#include -using namespace std; -string content = ""; +#include <3ds.h> +#include +using namespace std; +string content = ""; Result http_download(const char *url) { Result ret=0; @@ -133,9 +133,9 @@ Result http_download(const char *url) return -1; } - //printf("%s", buf); - content = reinterpret_cast(buf); - + //printf("%s", buf); + content = reinterpret_cast(buf); + gfxFlushBuffers(); @@ -159,147 +159,148 @@ Result http_download(const char *url) if (newurl!=NULL) free(newurl); return 0; -} - - -int main() { +} + + +int main() { Result ret=0; gfxInitDefault(); httpcInit(0); // Buffer size when POST/PUT. -PrintConsole topScreen, bottomScreen; - - //Initialize console for both screen using the two different PrintConsole we have defined - consoleInit(GFX_TOP, &topScreen); +PrintConsole topScreen, bottomScreen; + + //Initialize console for both screen using the two different PrintConsole we have defined + consoleInit(GFX_TOP, &topScreen); consoleInit(GFX_BOTTOM, &bottomScreen); - ret=http_download("http://animeflv.net/"); - int vval1= content.find("ltimos episodios"); - int vval2 = content.find("ltimos animes",vval1); - - content = content.substr(vval1,vval2 - vval1); - - int val1 = 1; - int val2; - int val0 = 0; -int arrayselect = 0; -int arraycount = 0; -vector arraychapter; -consoleSelect(&topScreen); -cout << "Lista de Episodios de Hoy:" << endl; - while(val0 != -1){ -val0= content.find("/ver/",val1); -if(val0 == -1){break;} - - val1 = content.find("/ver/",val1); - val2 = (content.find('"',val1)); - string gdrive = "http://animeflv.net"+ content.substr(val1,val2 - val1); - - -arraychapter.push_back(gdrive); -cout << arraycount<< ". "<< gdrive.substr(gdrive.rfind("/")+1) << endl; -arraycount++; -val1++; -} - - - consoleSelect(&bottomScreen); - cout << "\x1b[47;30mUse las flechas para elegir.\x1b[0m" << endl; - cout << "\x1b[47;30mPresiona A para lanzar el episodio.\x1b[0m" << endl; - cout << arrayselect << "/" << arraychapter.size() - 1<< endl; - cout <<"Nombre: \n" << arraychapter[arrayselect].substr(arraychapter[arrayselect].rfind("/")+1) << endl; -cout << "Enlace: \n" << arraychapter[arrayselect] << endl; + ret=http_download("http://animeflv.net/"); + int vval1= content.find("ltimos episodios"); + int vval2 = content.find("ltimos animes",vval1); + + content = content.substr(vval1,vval2 - vval1); + + int val1 = 1; + int val2; + int val0 = 0; +int arrayselect = 0; +int arraycount = 0; +vector arraychapter; +consoleSelect(&topScreen); +cout << "Lista de Episodios de Hoy:" << endl; + while(val0 != -1){ +val0= content.find("/ver/",val1); +if(val0 == -1){break;} + + val1 = content.find("/ver/",val1); + val2 = (content.find('"',val1)); + string gdrive = "http://animeflv.net"+ content.substr(val1,val2 - val1); + + +arraychapter.push_back(gdrive); +cout << arraycount<< ". "<< gdrive.substr(gdrive.rfind("/")+1) << endl; +arraycount++; +val1++; +} + + + consoleSelect(&bottomScreen); + cout << "\x1b[47;30mUse las flechas para elegir.\x1b[0m" << endl; + cout << "\x1b[47;30mPresiona A para lanzar el episodio.\x1b[0m" << endl; + cout << arrayselect << "/" << arraychapter.size() - 1<< endl; + cout <<"Nombre: \n" << arraychapter[arrayselect].substr(arraychapter[arrayselect].rfind("/")+1) << endl; +cout << "Enlace: \n" << arraychapter[arrayselect] << endl; // Try the following for redirection to the above URL. // ret=http_download("http://tinyurl.com/hd8jwqx"); gfxFlushBuffers(); - - while(aptMainLoop()) { - gspWaitForVBlank(); - hidScanInput(); - -u32 kDown = hidKeysDown(); - consoleSelect(&bottomScreen); - -if ( kDown & KEY_RIGHT ){ - - if (arrayselect < arraychapter.size() - 1) - { consoleClear(); - arrayselect++; - cout << "\x1b[47;30mUse las flechas para elegir.\x1b[0m" << endl; - cout << "\x1b[47;30mPresiona A para lanzar el episodio.\x1b[0m" << endl; - cout << arrayselect << "/" << arraychapter.size() - 1<< endl; - cout <<"Nombre: \n" << arraychapter[arrayselect].substr(arraychapter[arrayselect].rfind("/")+1) << endl; -cout << "Enlace: \n" << arraychapter[arrayselect] << endl; - - - -} - } - - if ( kDown & KEY_LEFT){ - - if (arrayselect > 0 ) - { consoleClear(); - arrayselect--; - cout << "\x1b[47;30mUse las flechas para elegir.\x1b[0m" << endl; - cout << "\x1b[47;30mPresiona A para lanzar el episodio.\x1b[0m" << endl; - cout << arrayselect << "/" << arraychapter.size() - 1<< endl; - cout <<"Nombre: \n" << arraychapter[arrayselect].substr(arraychapter[arrayselect].rfind("/")+1) << endl; -cout << "Enlace: \n" << arraychapter[arrayselect] << endl; - - -} - } - - - - - if(hidKeysDown() & KEY_A){ - consoleClear(); - ret=http_download(arraychapter[arrayselect].c_str()); - - int val1= content.find("gdrive"); - int val2 = content.find('"',val1); - - string gdrive = content.substr(val1,val2 - val1); - gdrive = "http://s3.animeflv.com/check.php?server=" + gdrive; - - - -content = ""; -ret=http_download(gdrive.c_str()); -val1 = content.find("http"); -val2 = content.find('"',val1); - -gdrive = content.substr(val1,val2 - val1); - consoleSelect(&bottomScreen); + + while(aptMainLoop()) { + gspWaitForVBlank(); + hidScanInput(); + +u32 kDown = hidKeysDown(); + consoleSelect(&bottomScreen); + +if ( kDown & KEY_RIGHT ){ + + if (arrayselect < arraychapter.size() - 1) + { consoleClear(); + arrayselect++; + cout << "\x1b[47;30mUse las flechas para elegir.\x1b[0m" << endl; + cout << "\x1b[47;30mPresiona A para lanzar el episodio.\x1b[0m" << endl; + cout << arrayselect << "/" << arraychapter.size() - 1<< endl; + cout <<"Nombre: \n" << arraychapter[arrayselect].substr(arraychapter[arrayselect].rfind("/")+1) << endl; +cout << "Enlace: \n" << arraychapter[arrayselect] << endl; + + + +} + } + + if ( kDown & KEY_LEFT){ + + if (arrayselect > 0 ) + { consoleClear(); + arrayselect--; + cout << "\x1b[47;30mUse las flechas para elegir.\x1b[0m" << endl; + cout << "\x1b[47;30mPresiona A para lanzar el episodio.\x1b[0m" << endl; + cout << arrayselect << "/" << arraychapter.size() - 1<< endl; + cout <<"Nombre: \n" << arraychapter[arrayselect].substr(arraychapter[arrayselect].rfind("/")+1) << endl; +cout << "Enlace: \n" << arraychapter[arrayselect] << endl; + + +} + } + + + + + if(hidKeysDown() & KEY_A){ + consoleClear(); + ret=http_download(arraychapter[arrayselect].c_str()); + + int val1= content.find("server=hyperion"); + int val2 = content.find('"',val1); + + string gdrive = content.substr(val1,val2 - val1); + gdrive = "http://s3.animeflv.com/check.php?" + gdrive; + + + +content = ""; +ret=http_download(gdrive.c_str()); +val1 = content.find(":360"); +val1 = content.find("http",val1); +val2 = content.find('"',val1); + +gdrive = content.substr(val1,val2 - val1); + consoleSelect(&bottomScreen); cout << gdrive << endl; // Try the following for redirection to the above URL. - // ret=http_download("http://tinyurl.com/hd8jwqx"); -consoleSelect(&topScreen); - consoleClear(); + // ret=http_download("http://tinyurl.com/hd8jwqx"); +consoleSelect(&topScreen); + consoleClear(); cout << "VIDEO EXTRAIDO: PRESIONA START PARA CONTINUAR." << endl; -APT_PrepareToStartSystemApplet(APPID_WEB); -APT_StartSystemApplet(APPID_WEB, gdrive.c_str(), 1024, 0); - - gfxFlushBuffers(); - - } - - - - if(hidKeysDown() & KEY_START) - break; - - gfxFlushBuffers(); - gfxSwapBuffers(); - } - - gfxExit(); - return 0; -} +APT_PrepareToStartSystemApplet(APPID_WEB); +APT_StartSystemApplet(APPID_WEB, gdrive.c_str(), 1024, 0); + + gfxFlushBuffers(); + + } + + + + if(hidKeysDown() & KEY_START) + break; + + gfxFlushBuffers(); + gfxSwapBuffers(); + } + + gfxExit(); + return 0; +}