#ifndef KINOX_H
#define KINOX_H
// flag 1 = putlocker/sockshare
// flag 2 = filenuke
char* kinox(char* link)
{
debug(99, "link: %s", link);
char* streamurl = NULL;
streamurl = hoster(link);
// debug(99, "streamurl1: %s", streamurl);
// streamurl = string_replace_all("amp;", "", streamurl, 1);
// debug(99, "streamurl2: %s", streamurl);
return streamurl;
}
int kinox_search(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
{
int ret = 1;
int debuglevel = getconfigint("debuglevel", NULL);
if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
return ret;
char* search = NULL;
if(flag == 0)
{
if(searchstr == NULL)
search = textinputhist(_("Search"), " ", "searchhist");
else
search = textinputhist(_("Search"), searchstr, "searchhist");
}
else
search = ostrcat(link, NULL, 0, 0);
if(search != NULL)
{
drawscreen(load, 0, 0);
char* tmpstr = NULL;
char* tmpstr1 = NULL;
char* line = NULL;
char* pic = NULL;
char* title = NULL;
char* lang = NULL;
char* langck = NULL;
char* from = NULL;
char* url = NULL;
char* ip = NULL;
char* path = NULL;
char* menu = NULL;
char* newurl = NULL;
char *cmd = NULL;
search = strstrip(search);
search = stringreplacechar(search, ' ', '+');
debug(99, "search: %s", search);
if(flag == 0)
path = ostrcat("Search.html?q=", search, 0, 0);
else
{
path = string_replace_all("kinox.to", "", search, 0);
path = string_replace_all(getconfig("tithek_kinox_url", NULL), "", search, 0);
path = string_replace_all("http:///", "", search, 0);
path = string_replace_all("https:///", "", search, 0);
}
// tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
newurl = ostrcat(getconfig("tithek_kinox_url", NULL), "/", 0, 0);
newurl = ostrcat(newurl, path, 1, 0);
// tmpstr = gethttps(newurl, NULL, NULL, NULL, NULL, NULL, 1);
// new start
cmd = ostrcat("/tmp/localhoster/hoster.sh get http://", newurl, 0, 0);
debug(99, "cmd: %s", cmd);
tmpstr = command(cmd);
free(cmd), cmd = NULL;
// new end
free(newurl), newurl = NULL;
tmpstr = string_resub("
", "", tmpstr, 0);
titheklog(debuglevel, "/tmp/kinox1_tmpstr", NULL, NULL, NULL, tmpstr);
int count = 0;
int incount = 0;
int i = 0;
struct splitstr* ret1 = NULL;
ret1 = strsplit(tmpstr, "\n", &count);
if(ret1 != NULL)
{
int max = count;
for(i = 0; i < max; i++)
{
if(oregex(".*src=\"/gr/sys/lng/(.*)\" alt=\"language\">.*", ret1[i].part) != NULL)
{
free(langck), langck = NULL;
langck = oregex(".*src=\"/gr/sys/lng/(.*)\" alt=\"language\">.*", ret1[i].part);
}
if(oregex(".*select->handle;
createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
ret = 0;
}
}
free(tmpstr), tmpstr = NULL;
free(ip), ip = NULL;
}
free(search), search = NULL;
return ret;
}
int kinox_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
{
char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL;
int ret = 1, count = 0, i = 0;
if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
return ret;
if(searchstr == NULL)
search = textinputhist(_("Search"), " ", "searchhist");
else
search = textinputhist(_("Search"), searchstr, "searchhist");
if(search != NULL)
{
drawscreen(load, 0, 0);
strstrip(search);
string_tolower(search);
tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/kinox/streams/kinox.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0);
struct splitstr* ret1 = NULL;
ret1 = strsplit(tmpstr, "\n", &count);
if(ret1 != NULL)
{
int max = count;
for(i = 0; i < max; i++)
{
tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0);
tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0');
string_tolower(tmpstr1);
if(ostrstr(tmpstr1, search) != NULL)
{
printf("found: %s\n", ret1[i].part);
int rcret = waitrc(NULL, 10, 0);
if(rcret == getrcconfigint("rcexit", NULL)) break;
line = ostrcat(line, ret1[i].part, 1, 0);
line = ostrcat(line, "\n", 0, 0);
}
free(tmpstr1), tmpstr1 = NULL;
}
free(ret1), ret1 = NULL;
if(line != NULL)
{
line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1);
menu = ostrcat("/tmp/tithek/kinox.search.", oitoa(time(NULL)), 0, 1);
menu = ostrcat(menu, ".list", 1, 0);
writesys(menu, line, 0);
struct tithek* tnode = (struct tithek*)listbox->select->handle;
createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
ret = 0;
}
}
free(tmpstr), tmpstr = NULL;
}
free(search), search = NULL;
return ret;
}
int kinox_hoster(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title)
{
debug(99, "link: %s", link);
int debuglevel = getconfigint("debuglevel", NULL);
int ret = 1, series = 0;
char* ip = NULL, *pos = NULL, *path = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *pichname = NULL;
char* tmpstr4 = NULL, *tmpstr5 = NULL, *line = NULL, *url = NULL, *url2 = NULL, *url3 = NULL, *url4 = NULL, *pathnew = NULL, *extra = NULL;
char* newurl = NULL;
char* cmd = NULL;
if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
return ret;
ip = string_replace("http://", "", (char*)link, 0);
if(ip != NULL)
pos = strchr(ip, '/');
if(pos != NULL)
{
pos[0] = '\0';
path = pos + 1;
}
// tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
// tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1);
// new start
cmd = ostrcat("/tmp/localhoster/hoster.sh get http://", link, 0, 0);
debug(99, "cmd: %s", cmd);
tmpstr = command(cmd);
free(cmd), cmd = NULL;
// new end
titheklog(debuglevel, "/tmp/kinox2_tmpstr", NULL, NULL, NULL, tmpstr);
if(tmpstr != NULL)
{
drawscreen(load, 0, 0);
if(ostrstr(tmpstr, "SeriesID") != NULL)
{
char* pos1 = NULL;
char* from = NULL;
char* folgen = NULL;
int i;
series = 1;
for(i = 1; i < 30; i++)
{
from = ostrcat(from, " |