Skip to content

Commit

Permalink
Updated AnimeFLV.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkxex authored Jun 24, 2017
1 parent 6cc3146 commit b35c04e
Showing 1 changed file with 135 additions and 134 deletions.
269 changes: 135 additions & 134 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <stdio.h>
#include <inttypes.h>
#include <iostream>
#include <3ds.h>
#include <Vector>
using namespace std;
string content = "";
#include <3ds.h>
#include <Vector>
using namespace std;
string content = "";
Result http_download(const char *url)
{
Result ret=0;
Expand Down Expand Up @@ -133,9 +133,9 @@ Result http_download(const char *url)
return -1;
}

//printf("%s", buf);
content = reinterpret_cast<char*>(buf);

//printf("%s", buf);
content = reinterpret_cast<char*>(buf);


gfxFlushBuffers();

Expand All @@ -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<string> 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<string> 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;
}

0 comments on commit b35c04e

Please sign in to comment.