Changeset 40893
- Timestamp:
- 09/02/17 21:42:56 (6 years ago)
- Location:
- titan/plugins/tithek
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/kinox.h
r40864 r40893 359 359 mirrormax = atoi(mirrormaxtmp); 360 360 361 debug(99, "### START ####################################################"); 362 361 363 for(j = 1; j < mirrormax + 1; j++) 362 364 { … … 366 368 367 369 hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); 368 hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); 369 hlink = ostrcat(hlink, "Mirror=", 0, 0); 370 371 hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); 372 pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); 373 374 pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); 370 371 if (hlink == NULL) 372 { 373 hlink = string_resub("rel=\"", "\">", ret1[i].part, 0); 374 hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); 375 hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); 376 pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); 377 pathnew = ostrcat(pathnewtmp, NULL, 0, 0); 378 } 379 else 380 { 381 hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); 382 hlink = ostrcat(hlink, "Mirror=", 0, 0); 383 hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); 384 pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); 385 pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); 386 } 375 387 debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp); 376 388 free(pathnewtmp), pathnewtmp= NULL; … … 491 503 492 504 debug(99, "-------------------------------"); 493 if(ostrcmp(url, url2) != 0)494 {495 debug(99, "(%d/%d) (%d/%d) %s (Part1) url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra);496 }497 else498 {505 // if(ostrcmp(url, url2) != 0) 506 // { 507 // debug(99, "(%d/%d) (%d/%d) %s (Part1) url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra); 508 // } 509 // else 510 // { 499 511 debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra); 500 } 512 // } 513 debug(99, "-------------------------------"); 501 514 502 515 incount += 1; … … 664 677 free(extra), extra = NULL; 665 678 } 679 debug(99, "### END #####################################################"); 666 680 } 667 681 } … … 792 806 free(mirrormaxtmp), mirrormaxtmp= NULL; 793 807 808 debug(99, "### START ####################################################"); 809 794 810 for(j = 1; j < mirrormax + 1; j++) 795 811 { … … 798 814 hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0); 799 815 816 // hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); 817 // hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); 818 // hlink = ostrcat(hlink, "Mirror=", 0, 0); 819 820 ////////// 800 821 hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); 801 hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); 802 hlink = ostrcat(hlink, "Mirror=", 0, 0); 803 822 823 if (hlink == NULL) 824 { 825 hlink = string_resub("rel=\"", "\">", ret1[i].part, 0); 826 hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); 827 hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); 828 pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); 829 pathnew = ostrcat(pathnewtmp, NULL, 0, 0); 830 } 831 else 832 { 833 hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); 834 hlink = ostrcat(hlink, "Mirror=", 0, 0); 835 hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); 836 pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); 837 pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); 838 } 839 debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp); 840 free(pathnewtmp), pathnewtmp= NULL; 841 ////////// 804 842 hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); 805 843 pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); … … 826 864 hlink = string_replace("http://kinox.me/Stream/", "", hlink, 1); 827 865 828 debug(99, "pathnew: %s", pathnew);866 // debug(99, "pathnew: %s", pathnew); 829 867 tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); 830 debug(99, "tmpstr1 1: %s", tmpstr1);868 // debug(99, "tmpstr1 1: %s", tmpstr1); 831 869 832 870 tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); 833 debug(99, "tmpstr1 2: %s", tmpstr1);871 // debug(99, "tmpstr1 2: %s", tmpstr1); 834 872 835 873 if(ostrstr(tmpstr1, "<iframe src=") != NULL) 836 874 { 837 875 url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); 838 debug(99, "iframe1.1 url: %s", url);876 // debug(99, "iframe1.1 url: %s", url); 839 877 } 840 878 else if(ostrstr(tmpstr1, "/iframe>") != NULL) … … 842 880 free(pathnew), pathnew = NULL; 843 881 pathnew = ostrcat("kinox.me/aGET/Mirror/", hlink, 0, 0); 844 debug(99, "iframe2.1 pathnew: %s", pathnew);882 // debug(99, "iframe2.1 pathnew: %s", pathnew); 845 883 free(tmpstr1), tmpstr1 = NULL; 846 884 tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); 847 debug(99, "iframe2.2 tmpstr1: %s", tmpstr1);885 // debug(99, "iframe2.2 tmpstr1: %s", tmpstr1); 848 886 tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); 849 debug(99, "iframe2.3 tmpstr1: %s", tmpstr1);887 // debug(99, "iframe2.3 tmpstr1: %s", tmpstr1); 850 888 851 889 if(ostrstr(tmpstr1, "<iframe src=") != NULL) 852 890 { 853 891 url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); 854 debug(99, "iframe2.4 url: %s", url);892 // debug(99, "iframe2.4 url: %s", url); 855 893 } 856 894 } … … 858 896 { 859 897 tmpstr1 = string_resub("<a href=\"", "\"", tmpstr1, 0); 860 debug(99, "tmpstr1 3: %s", tmpstr1);898 // debug(99, "tmpstr1 3: %s", tmpstr1); 861 899 url = ostrcat(tmpstr1, NULL, 0, 0); 862 900 } … … 866 904 debug(99, "-------------------------------"); 867 905 debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s", i, max, j, mirrormax, hname, url, extra); 906 debug(99, "-------------------------------"); 868 907 869 908 incount += 1; … … 911 950 free(extra), extra = NULL; 912 951 } 952 debug(99, "### END #####################################################"); 913 953 } 914 954 } -
titan/plugins/tithek/tithek.h
r40856 r40893 944 944 tmp->posx = posx; 945 945 946 printf("flag=%d\n", titheknode->flag); 947 printf("title=%s\n", titheknode->title); 948 printf("menutitle=%s\n", titheknode->menutitle); 949 printf("skin title=%s\n", title); 950 printf("titheklink=%s\n", titheklink); 951 946 debug(99, "--- START ----------------------------------------------------"); 952 947 if(title != NULL) 953 948 tmpstr1 = ostrcat(title, " - ", 0, 0); … … 955 950 tmpstr1 = ostrcat(titheknode->menutitle, " - ", 0, 0); 956 951 957 tmpstr2 = ostrcat(tmpstr1, titheknode->title, 0, 0); 958 959 printf("tmpstr2=%s\n", tmpstr2); 952 tmpstr1 = ostrcat(tmpstr1, titheknode->title, 1, 0); 953 954 // tmpstr2 = createfilename(tmpstr1, titheknode->menutitle); 955 tmpstr2 = createfilename(tmpstr1, NULL, 0); 956 int new = 0; 957 if(file_exist(tmpstr2)) 958 { 959 new = 1; 960 debug(99, "found oldfile %s", tmpstr2); 961 } 962 free(tmpstr2), tmpstr2 = NULL; 963 964 tmpstr2 = createfilename(tmpstr1, NULL, 1); 965 int fav = 0; 966 if(file_exist(tmpstr2)) 967 { 968 fav = 1; 969 debug(99, "found oldfav %s", tmpstr2); 970 } 971 free(tmpstr2), tmpstr2 = NULL; 972 960 973 free(tmpstr1), tmpstr1 = NULL; 961 free(tmpstr2), tmpstr2 = NULL; 962 963 char* title2 = ostrcat(titheknode->title, NULL, 0, 0); 964 char* filename = createfilename(tmpstr2, title2); 965 // char* filename = createfilename(tmpstr2, titheknode->title); 966 free(title2), title2 = NULL; 967 debug(99, "filename: %s", filename); 968 free(filename), filename = NULL; 969 970 971 if(python == 0 && titheknode->flag == 14) 972 tmp->fontcol = 0xff0000; 974 975 debug(99, "--- END -----------------------------------------------------"); 976 977 if(fav == 1) 978 // tmp->fontcol = 0x0091c9; //get favcol=0091c9 979 tmp->fontcol = convertcol("favcol"); 980 else if(new == 1) 981 tmp->fontcol = convertcol("green"); 982 else if(python == 0 && titheknode->flag == 14) 983 tmp->fontcol = convertcol("red"); 973 984 else if(python == 1 && titheknode->flag == 14) 974 tmp->fontcol = 0xffffff; 975 //tmp->fontcol = 0x00ff00; 985 tmp->fontcol = convertcol("white"); 976 986 else 977 tmp->fontcol = 0xffffff; 978 //tmp->fontcol = 0x0000ff; 987 tmp->fontcol = convertcol("white"); 979 988 980 989 tmp->halign = CENTER; … … 1021 1030 } 1022 1031 1032 //void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag) 1023 1033 void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag) 1024 1034 { 1035 1036 debug(99, "removefav title: %s", title); 1037 debug(99, "removefav menutitle: %s", menutitle); 1038 1025 1039 int count = 0, i = 0; 1026 char* tmpstr = NULL, *tmpstr1 = NULL, * input = NULL;1040 char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *input = NULL; 1027 1041 struct splitstr* ret = NULL; 1028 1042 … … 1053 1067 } 1054 1068 else 1069 { 1055 1070 printf("remove: %s\n", ret[i].part); 1071 1072 // tmpstr2 = createfilename(fullmenutitle, title, 1); 1073 tmpstr2 = createfilename(menutitle, title, 1); 1074 1075 debug(99, "tmpstr2: %s", tmpstr2); 1076 1077 if(file_exist(tmpstr2)) 1078 { 1079 unlink(tmpstr2); 1080 debug(99, "remove favorite color entry %s", tmpstr2); 1081 } 1082 free(tmpstr2), tmpstr2 = NULL; 1083 } 1056 1084 } 1057 1085 } … … 1078 1106 } 1079 1107 1108 //void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag) 1080 1109 void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag) 1081 1110 { … … 1126 1155 else 1127 1156 savefile = ostrcat(getconfig("tithek_fav", NULL), NULL, 0, 0); 1157 1158 // char* title2 = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0); 1159 // char* filename = createfilename(title, title2); 1160 // char* filename = createfilename(title, ((struct tithek*)listbox->select->handle)->title); 1161 1162 1163 // debug(99, "fullmenutitle: %s", fullmenutitle); 1164 debug(99, "menutitle: %s", menutitle); 1165 debug(99, "title: %s", title); 1166 1167 1168 tmpstr = createfilename(menutitle, title, 1); 1169 // tmpstr = createfilename(fullmenutitle, title, 1); 1170 1171 debug(99, "tmpstr: %s", tmpstr); 1172 1173 if(!file_exist(tmpstr)) 1174 { 1175 writesys(tmpstr, "1", 0); 1176 debug(99, "add favorite color entry %s", tmpstr); 1177 } 1178 free(tmpstr), tmpstr = NULL; 1128 1179 1129 1180 input = ostrcat(input, title, 1, 0); … … 1179 1230 } 1180 1231 1232 //void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag) 1181 1233 void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag) 1182 1234 { … … 1217 1269 { 1218 1270 drawscreen(load, 0, 0); 1271 // addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, fullmenutitle, atoi(skin_type->ret)); 1219 1272 addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, atoi(skin_type->ret)); 1220 1273 clearscreen(load); … … 1609 1662 { 1610 1663 char* title2 = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0); 1611 char* filename = createfilename(title, title2 );1664 char* filename = createfilename(title, title2, 0); 1612 1665 // char* filename = createfilename(title, ((struct tithek*)listbox->select->handle)->title); 1613 1666 free(title2), title2 = NULL; 1614 1667 debug(99, "filename: %s", filename); 1668 1669 if(!file_exist(filename)) 1670 { 1671 writesys(filename, "1", 0); 1672 debug(99, "create newfile %s", filename); 1673 } 1615 1674 1616 1675 char* keyconf = NULL; … … 2523 2582 { 2524 2583 removefav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag); 2584 // removefav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, title, ((struct tithek*)listbox->select->handle)->flag); 2585 2525 2586 pagecount = createtithekplay(titheklink, grid, listbox, countlabel, title, 0); 2526 2587 if(pagecount == 0) return; … … 2538 2599 if(textbox(_("Message"), _("Add this link as Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1) 2539 2600 { 2540 addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag); 2601 // addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, title, ((struct tithek*)listbox->select->handle)->flag); 2602 addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, title, ((struct tithek*)listbox->select->handle)->flag); 2541 2603 } 2542 2604 } … … 2550 2612 if(textbox(_("Message"), _("Edit this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1) 2551 2613 { 2614 // editfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, title, ((struct tithek*)listbox->select->handle)->flag); 2552 2615 editfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag); 2553 2616 pagecount = createtithekplay(titheklink, grid, listbox, countlabel, title, 0); -
titan/plugins/tithek/tithek_global.h
r40881 r40893 571 571 } 572 572 573 //char* crea tefilename(char* title, struct skin* listbox)574 char* createfilename (char* title, char* title2)573 //char* crea(char* title, struct skin* listbox) 574 char* createfilename1(char* title, char* title2) 575 575 { 576 576 char* filename = NULL; … … 658 658 return filename; 659 659 } 660 /* 661 printf("flag=%d\n", titheknode->flag); 662 printf("title=%s\n", titheknode->title); 663 printf("menutitle=%s\n", titheknode->menutitle); 664 printf("skin title=%s\n", title); 665 printf("titheklink=%s\n", titheklink); 666 667 if(title != NULL) 668 tmpstr1 = ostrcat(title, " - ", 0, 0); 669 else 670 tmpstr1 = ostrcat(titheknode->menutitle, " - ", 0, 0); 671 672 tmpstr1 = ostrcat(tmpstr1, titheknode->title, 1, 0); 673 // tmpstr1 = ostrcat(tmpstr1, ".mp4", 1, 0); 674 675 tmpstr1 = string_replace_all(" - ", "_", tmpstr1, 1); 676 677 tmpstr1 = string_replace_all(") (", ")_(", tmpstr1, 1); 678 tmpstr1 = string_replace_all(" ", "-", tmpstr1, 1); 679 printf("tmpstr1=%s\n", tmpstr1); 680 681 tmpstr2 = ostrcat("/mnt/swapextensions/player/", tmpstr1, 0, 0); 682 free(tmpstr1), tmpstr1 = NULL; 683 */ 684 685 //char* createfilename(char* title, struct skin* listbox) 686 char* createfilename(char* title, char* title2, int flag) 687 { 688 debug(99, "title: %s title2: %s", title, title2); 689 char* filename = NULL; 690 char* tmpstr = NULL; 691 692 if(title2 != NULL) 693 { 694 tmpstr = ostrcat(title, " - ", 0, 0); 695 tmpstr = ostrcat(tmpstr, title2, 1, 0); 696 } 697 else 698 tmpstr = ostrcat(title, NULL, 0, 0); 699 700 tmpstr = string_replace_all(" - ", "_", tmpstr, 1); 701 // filename = string_replace_all(") (", ")_(", filename, 1); 702 tmpstr = string_replace_all(" ", "-", tmpstr, 1); 703 tmpstr = string_replace_all("(", "", tmpstr, 1); 704 tmpstr = string_replace_all(")", "", tmpstr, 1); 705 tmpstr = string_replace_all("/", "-", tmpstr, 1); 706 707 if(flag == 0) 708 filename = ostrcat("/mnt/swapextensions/player/", tmpstr, 0, 0); 709 if(flag == 1) 710 filename = ostrcat("/mnt/swapextensions/player/FAV_", tmpstr, 0, 0); 711 712 free(tmpstr), tmpstr = NULL; 713 debug(99, "filename: %s", filename); 714 715 return filename; 716 } 717 718 660 719 661 720 int all_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag) -
titan/plugins/tithek/tithek_header.h
r40856 r40893 3 3 4 4 //char* createfilename(char* title, struct skin* listbox); 5 char* createfilename(char* title, char* title2 );5 char* createfilename(char* title, char* title2, int flag); 6 6 char* jsunpack(char* input); 7 7 char* gethttps(char* url, char* localfile, char* data, char* user, char* pass, char* referer, int flag);
Note: See TracChangeset
for help on using the changeset viewer.