Changeset 36966 for titan/plugins/tithek/tithek_global.h
- Timestamp:
- 01/27/16 23:34:04 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/tithek_global.h
r36955 r36966 693 693 } 694 694 695 char* localparser_hoster(char* link) 696 { 697 debug(99, "local_parser link: %s", link); 698 int debuglevel = getconfigint("debuglevel", NULL); 699 int ret = 1; 700 char* tmpstr = NULL, *streamurl = NULL; 701 702 tmpstr = command(link); 703 tmpstr = string_newline(tmpstr); 704 705 streamurl = hoster(tmpstr); 706 free(tmpstr), tmpstr = NULL; 707 708 return streamurl; 709 } 710 711 712 //int localparser_search(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title) 713 int localparser_search(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag) 714 { 715 char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL; 716 int ret = 1, count = 0, i = 0; 717 718 if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) 719 return ret; 720 721 if(searchstr == NULL) 722 search = textinputhist(_("Search"), " ", "searchhist"); 723 else 724 search = textinputhist(_("Search"), searchstr, "searchhist"); 725 726 if(search != NULL) 727 { 728 drawscreen(load, 0, 0); 729 730 strstrip(search); 731 string_tolower(search); 732 733 tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/youtube/streams/youtube.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0); 734 735 struct splitstr* ret1 = NULL; 736 ret1 = strsplit(tmpstr, "\n", &count); 737 738 if(ret1 != NULL) 739 { 740 int max = count; 741 for(i = 0; i < max; i++) 742 { 743 744 tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0); 745 tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0'); 746 string_tolower(tmpstr1); 747 748 if(ostrstr(tmpstr1, search) != NULL) 749 { 750 printf("found: %s\n", ret1[i].part); 751 int rcret = waitrc(NULL, 10, 0); 752 if(rcret == getrcconfigint("rcexit", NULL)) break; 753 754 line = ostrcat(line, ret1[i].part, 1, 0); 755 line = ostrcat(line, "\n", 0, 0); 756 } 757 free(tmpstr1), tmpstr1 = NULL; 758 } 759 free(ret1), ret1 = NULL; 760 761 if(line != NULL) 762 { 763 line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); 764 menu = ostrcat("/tmp/tithek/youtube.search.list", NULL, 0, 0); 765 writesys(menu, line, 0); 766 struct tithek* tnode = (struct tithek*)listbox->select->handle; 767 createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); 768 ret = 0; 769 } 770 } 771 free(tmpstr), tmpstr = NULL; 772 } 773 free(search), search = NULL; 774 return ret; 775 } 776 695 777 #endif
Note: See TracChangeset
for help on using the changeset viewer.