Changeset 36082
- Timestamp:
- Nov 6, 2015, 12:14:05 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/tvtoast.h
r36074 r36082 249 249 char* tokenid = NULL; 250 250 251 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);251 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 252 252 /////// 253 253 // fix espn … … 300 300 free(send), send = NULL; 301 301 /////// 302 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);302 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 303 303 /////// 304 304 … … 331 331 free(send), send = NULL; 332 332 /////// 333 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);333 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 334 334 /////// 335 335 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); … … 413 413 414 414 free(send), send = NULL; 415 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);415 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 416 416 417 417 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); … … 482 482 483 483 484 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);484 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 485 485 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast7_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); 486 486 // free(tmppath), tmppath = NULL; … … 501 501 } 502 502 503 char* streamlive(char* tmpurl1, char* tmppath1, int www, int incount)503 char* streamlive(char* tmpurl1, char* tmppath1, char* referer1, int www, int incount) 504 504 { 505 505 debug(99, "tmpurl %s", tmpurl1); … … 534 534 char* tokenid = NULL; 535 535 536 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);536 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 537 537 /////// 538 538 // fix espn … … 585 585 free(send), send = NULL; 586 586 /////// 587 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);587 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 588 588 /////// 589 589 … … 616 616 free(send), send = NULL; 617 617 /////// 618 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);618 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 619 619 /////// 620 620 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); … … 698 698 699 699 free(send), send = NULL; 700 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);700 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 701 701 702 702 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); … … 767 767 768 768 769 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1);769 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, NULL, 1); 770 770 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast7_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); 771 771 // free(tmppath), tmppath = NULL; … … 784 784 debug(99, "streamurl1 %s", streamurl1); 785 785 return streamurl1; 786 } 787 788 char* zerocast(char* tmpurl, char* tmppath, char* referer, int www, int incount) 789 { 790 debug(99, "tmpurl %s", tmpurl); 791 debug(99, "tmppath %s", tmppath); 792 debug(99, "referer %s", referer); 793 debug(99, "www %d", www); 794 debug(99, "incount %d", incount); 795 char* streamurl = NULL; 796 797 debug(99, "streamurl %s", streamurl); 798 return streamurl; 799 } 800 801 char* usachannels(char* tmpurl, char* tmppath, char* referer, int www, int incount) 802 { 803 debug(99, "tmpurl %s", tmpurl); 804 debug(99, "tmppath %s", tmppath); 805 debug(99, "referer %s", referer); 806 debug(99, "www %d", www); 807 debug(99, "incount %d", incount); 808 char* streamurl = NULL; 809 810 debug(99, "streamurl %s", streamurl); 811 return streamurl; 812 } 813 814 char* cricfree(char* tmpurl, char* tmphost, char* referer, int www, int incount) 815 { 816 int debuglevel = getconfigint("debuglevel", NULL); 817 debug(99, "tmpurl %s", tmpurl); 818 debug(99, "tmphost %s", tmphost); 819 debug(99, "referer %s", referer); 820 debug(99, "www %d", www); 821 debug(99, "incount %d", incount); 822 823 char* url = NULL; 824 char* token = NULL; 825 char* streamurl = NULL; 826 char* tmpstr = NULL; 827 char* tmplink = NULL; 828 char* fid = NULL; 829 char* width = NULL; 830 char* height = NULL; 831 char* pageurl = NULL; 832 833 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, referer, 1); 834 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast4_tmpstr", oitoa(incount), tmphost, NULL, tmpstr); 835 836 //<script type='text/javascript'>id='espnuk'; width='620'; height='490';</script><script type='text/javascript' src='http://theactionlive.com/livegamecr.js'></script> 837 //document.write('<iframe width="'+width+'" height="'+height+'" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" allowtransparency="true" src="http://theactionlive.com/livegamecr2.php?id='+id+'&width='+width+'&height='+height+'&stretching='+stretching+'"></iframe>'); 838 839 fid = string_resub("id='", "'", tmpstr, 0); 840 width = string_resub("v_width=", ";", tmpstr, 0); 841 height = string_resub("v_height=", ";", tmpstr, 0); 842 url = string_resub("src='", "'", tmpstr, 0); 843 844 if(width == NULL) 845 width = string_resub("width='", "'", tmpstr, 0); 846 if(height == NULL) 847 height = string_resub("height='", "'", tmpstr, 0); 848 849 if(width == NULL) 850 width = string_resub("var width = '", "'", tmpstr, 0); 851 if(height == NULL) 852 height = string_resub("var height = '", "'", tmpstr, 0); 853 854 debug(99, "fid: %s", fid); 855 debug(99, "width: %s", width); 856 debug(99, "height: %s", height); 857 debug(99, "url: %s", url); 858 859 tmpstr = gethttps(url, NULL, NULL, NULL, NULL, tmpurl, 1); 860 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast5_tmpstr", oitoa(incount), tmphost, NULL, tmpstr); 861 pageurl = string_resub("src=\"", "\"", tmpstr, 0); 862 pageurl = string_replace_all(" ", "", pageurl, 1); 863 pageurl = string_replace_all("+v_", "+", pageurl, 1); 864 pageurl = string_replace("'+fid+'", "'+id+'", pageurl, 1); 865 pageurl = string_replace("'+id+'", fid, pageurl, 1); 866 pageurl = string_replace("'+width+'", width, pageurl, 1); 867 pageurl = string_replace("'+height+'", height, pageurl, 1); 868 pageurl = string_replace("'+stretching+'", "", pageurl, 1); 869 870 debug(99, "pageurl: %s", pageurl); 871 tmpstr = gethttps(pageurl, NULL, NULL, NULL, NULL, tmpurl, 1); 872 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), tmphost, NULL, tmpstr); 873 874 url = string_resub("file: \"", "\"", tmpstr, 0); 875 876 if(url == NULL) 877 { 878 // biggestplayer.me 879 // url: http://biggestplayer.me/playercr.js, file=tithek_global.h, func=gethttps, line=124 880 881 fid = string_resub("id='", "'", tmpstr, 0); 882 url = string_resub("src='", "'", tmpstr, 0); 883 884 debug(99, "url: %s", url); 885 debug(99, "fid: %s", fid); 886 debug(99, "width: %s", width); 887 debug(99, "height: %s", height); 888 889 url = string_replace_all(" ", "", url, 1); 890 url = string_replace_all("+v_", "+", url, 1); 891 url = string_replace_all("'+", "+", url, 1); 892 url = string_replace_all("+'", "+", url, 1); 893 url = string_replace("+fid+", "+id+", url, 1); 894 url = string_replace("+id+", fid, url, 1); 895 url = string_replace("+width+", width, url, 1); 896 url = string_replace("+height+", height, url, 1); 897 url = string_replace("+stretching+", "", url, 1); 898 899 debug(99, "url: %s", url); 900 tmpstr = gethttps(url, NULL, NULL, NULL, NULL, tmpurl, 1); 901 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast7_tmpstr", oitoa(incount), tmphost, NULL, tmpstr); 902 903 // url: http://biggestplayer.me/streamcrnoscrape.php?id=+id+&width=&height=, 904 905 url = string_resub("src=\"", "\"", tmpstr, 0); 906 url = string_replace_all(" ", "", url, 1); 907 url = string_replace_all("+v_", "+", url, 1); 908 url = string_replace_all("'+", "+", url, 1); 909 url = string_replace_all("+'", "+", url, 1); 910 url = string_replace("+fid+", "+id+", url, 1); 911 url = string_replace("+id+", fid, url, 1); 912 url = string_replace("+width+", width, url, 1); 913 url = string_replace("+height+", height, url, 1); 914 url = string_replace("+stretching+", "", url, 1); 915 916 debug(99, "url: %s", url); 917 tmpstr = gethttps(url, NULL, NULL, NULL, NULL, pageurl, 1); 918 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast8_tmpstr", oitoa(incount), tmphost, NULL, tmpstr); 919 streamurl = string_resub("file: \"", "\"", tmpstr, 0); 920 } 921 else 922 { 923 924 token = string_resub("securetoken: \"", "\"", tmpstr, 0); 925 debug(99, "url: %s", url); 926 debug(99, "token: %s", token); 927 928 streamurl = ostrcat(streamurl, url, 1, 0); 929 streamurl = ostrcat(streamurl, " swfUrl=http://p.jwpcdn.com/6/11/jwplayer.flash.swf", 1, 0); 930 // streamurl = ostrcat(streamurl, swfUrl, 1, 0); 931 streamurl = ostrcat(streamurl, " live=1", 1, 0); 932 streamurl = ostrcat(streamurl, " token=", 1, 0); 933 streamurl = ostrcat(streamurl, token, 1, 0); 934 streamurl = ostrcat(streamurl, " timeout=15", 1, 0); 935 streamurl = ostrcat(streamurl, " swfVfy=1", 1, 0); 936 streamurl = ostrcat(streamurl, " pageUrl=", 1, 0); 937 streamurl = ostrcat(streamurl, pageurl, 1, 0); 938 } 939 /* 940 941 942 streamurl = ostrcat(streamerl, " app=", 0, 0); 943 streamurl = ostrcat(streamurl, app, 1, 0); 944 streamurl = ostrcat(streamurl, " playpath=", 1, 0); 945 streamurl = ostrcat(streamurl, playpath, 1, 0); 946 947 rtmp://31.220.2.148/redirect/espnusa swfUrl=http://p.jwpcdn.com/6/11/jwplayer.flash.swf live=1 token=%Zrey(nKa@#Z timeout=14 swfVfy=1 pageUrl=http://yotv.co/embed.php?live=espnusa&vw=620&vh=490 948 rtmp://31.220.2.148/redirect/espnusa 949 swfUrl=http://p.jwpcdn.com/6/11/jwplayer.flash.swf 950 live=1 951 token=%Zrey(nKa@#Z 952 timeout=14 953 swfVfy=1 954 pageUrl=http://yotv.co/embed.php?live=espnusa&vw=620&vh=490 955 956 <script type="text/javascript"> 957 var playerInstance = jwplayer("myElement"); 958 playerInstance.setup({ 959 file: "rtmp://31.220.2.148/redirect/espnusa", 960 aboutlink: "http://yotv.co", 961 abouttext: "Yotv", 962 skin: "glow", 963 width: "620", 964 height: "490", 965 autostart: "true", 966 repeat: "true", 967 rtmp: { 968 securetoken: "%Zrey(nKa@#Z" 969 } 970 }); 971 </script> 972 */ 973 974 debug(99, "streamurl %s", streamurl); 975 return streamurl; 786 976 } 787 977 … … 810 1000 char* urlid = NULL; 811 1001 char* tokenid = NULL; 812 1002 1003 1004 813 1005 ip = string_replace("http://", "", (char*)link, 0); 814 1006 … … 826 1018 827 1019 debug(99, "link: %s", tmplink); 828 tmpstr = gethttps(tmplink, NULL, NULL, NULL, NULL, 1);1020 tmpstr = gethttps(tmplink, NULL, NULL, NULL, NULL, NULL, 1); 829 1021 // tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); 830 1022 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast1_tmpstr", "1", tmphost, tmppath, tmpstr); … … 863 1055 tmplink = string_resub("<a href=\"", "\"", ret1[i].part, 0); 864 1056 tmplink = string_replace_all(" ", "%20", tmplink, 1); 865 tmpstr = gethttps(tmplink, NULL, NULL, NULL, NULL, 1);1057 tmpstr = gethttps(tmplink, NULL, NULL, NULL, NULL, NULL, 1); 866 1058 867 1059 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast3_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); … … 880 1072 tmppath = string_replace_all("http://", "", tmppath, 1); 881 1073 882 1074 debug(99, "tmpurl%d tmpurl: %s", incount, tmpurl); 1075 printf("test\n"); 883 1076 if(ostrstr(tmpurl, "www.streamlive.to") != NULL) 884 streamurl = streamlive(tmpurl, tmphost, www, incount); 1077 streamurl = streamlive(tmpurl, tmphost, tmplink, www, incount); 1078 1079 if(ostrstr(tmpurl, "zerocast.tv") != NULL) 1080 streamurl = zerocast(tmpurl, tmphost, tmplink, www, incount); 1081 1082 if(ostrstr(tmpurl, "usachannels.tv") != NULL) 1083 streamurl = usachannels(tmpurl, tmphost, tmplink, www, incount); 1084 1085 if(ostrstr(tmpurl, "cricfree.sx") != NULL) 1086 streamurl = cricfree(tmpurl, tmphost, tmplink, www, incount); 885 1087 886 1088 debug(99, "streamurl%d streamurl: %s", incount, streamurl); 887 1089 888 ////////////////////////////////////////// 889 if(streamurl == NULL) 890 { 891 ////////////////////////////////////////// 892 893 /////// 894 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1); 895 /////// 896 // fix espn 897 referer = ostrcat(tmpurl, NULL, 0, 0); 898 fid = string_resub("fid=\"", "\"", tmpstr, 0); 899 if(fid == NULL) 900 fid = string_resub("fid='", "'", tmpstr, 0); 901 902 debug(99, "tvtoast3_tmpstr%d fid: %s", incount, fid); 903 904 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast4_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); 905 free(tmppath), tmppath = NULL; 906 // free(tmphost), tmphost = NULL; 907 free(tmpurl), tmpurl = NULL; 908 909 if(ostrstr(tmpstr, "rtmp://") != NULL || ostrstr(tmpstr, "rtmpe://") != NULL) 910 { 911 streamurl = getrtmp(tmpstr, tmphost, tmppath, &typemsg, fid, incount); 912 } 913 914 if(www == 1) 915 { 916 printf("tvtoast4_tmpstr%d: if www\n", incount); 917 if(ostrstr(tmpstr, "Moved Permanently") != NULL && ostrstr(tmphost, "www.") == NULL) 918 { 919 printf("tvtoast4_tmpstr%d: if www if Moved Permanently\n", incount); 920 printf("found Moved Permanently\n"); 921 free(tmpstr), tmpstr = NULL; 922 tmpstr = ostrcat("www.", tmphost, 0, 0); 923 free(tmphost), tmphost = NULL; 924 tmphost = ostrcat(tmpstr, NULL, 0, 0); 925 } 926 else 927 { 928 printf("tvtoast4_tmpstr%d: if www else Moved Permanently\n", incount); 929 930 if(fid == NULL) 931 fid = string_resub("fid='", "'", tmpstr, 0); 932 free(tmppath), tmppath = NULL; 933 free(tmphost), tmphost = NULL; 934 tmpurl = string_resub("src='", "'", tmpstr, 0); 935 // if(tmpurl == NULL) 936 // tmpurl = string_resub("src=\"", "\"", tmpstr, 0); 937 938 free(tmpstr), tmpstr = NULL; 939 tmphost = string_resub("http://", "/", tmpurl, 0); 940 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 941 tmppath = string_replace_all("http://", "", tmppath, 1); 942 943 free(send), send = NULL; 944 /////// 945 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1); 946 /////// 947 948 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast5_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); 949 // free(tmppath), tmppath = NULL; 950 // free(tmphost), tmphost = NULL; 951 // free(tmpurl), tmpurl = NULL; 952 953 streamer = string_resub("streamer: \"", "\"", tmpstr, 0); 954 debug(99, "tvtoast5_tmpstr%d streamer: %s", incount, streamer); 955 debug(99, "tvtoast5_tmpstr%d fid: %s", incount, fid); 956 957 if(streamer == NULL)// && fid == NULL) 958 { 959 printf("streamer and fid null\n"); 960 961 tmpurl = string_resub("src='", "'", tmpstr, 0); 962 if(tmpurl == NULL || ostrncmp("http://", tmpurl, 7)) 963 tmpurl = string_resub("src=\"", "\"", tmpstr, 0); 964 if(tmpurl == NULL || ostrncmp("http://", tmpurl, 7)) 965 tmpurl = string_resub("var url = '", "'", tmpstr, 0); 966 967 debug(99, "tvtoast5_tmpstr%d tmpurl=%s", tmpurl) 968 969 free(tmpstr), tmpstr = NULL; 970 tmphost = string_resub("http://", "/", tmpurl, 0); 971 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 972 tmppath = string_replace_all("http://", "", tmppath, 1); 973 974 free(send), send = NULL; 975 /////// 976 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1); 977 /////// 978 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); 979 // free(tmppath), tmppath = NULL; 980 // free(tmphost), tmphost = NULL; 981 free(tmpurl), tmpurl = NULL; 982 983 ///////////////////////// 984 985 swfUrl = string_resub("<script type=\"text/javascript\" src=\"", "\"", tmpstr, 0); 986 fid = string_resub("'file': '", "',", tmpstr, 0); 987 988 debug(99, "tvtoast6_tmpstr%d swfUrl=%s", swfUrl) 989 debug(99, "tvtoast6_tmpstr%d fid=%s", fid) 990 991 if(ostrstr(tmpstr, "rtmp://") != NULL) 992 { 993 streamurl = getrtmp(tmpstr, tmphost, tmppath, &typemsg, fid, incount); 994 debug(99, "tvtoast6_tmpstr%d set streamurl=%s", streamurl) 995 996 //rtmp://37.220.32.52:443/liverepeater playpath=stream3 swfUrl=http://static.surk.tv/player.swf pageUrl=http://1cdn.filotv.pw/stream3.html token=#atd%#$ZH 997 } 998 } 999 1000 debug(99, "tvtoast6_tmpstr%d streamurl=%s", streamurl) 1001 1002 if(streamurl == NULL) 1003 { 1004 streamer = string_replace_all("\\", "", streamer, 1); 1005 1006 playpath = string_resub("file: \"", "\"", tmpstr, 0); 1007 playpath = string_replace_all(".flv", "", playpath, 1); 1008 1009 swfUrl = string_resub("type: 'flash', src: '", "'", tmpstr, 0); 1010 swfUrl = string_replace_all("//", "http://", swfUrl, 1); 1011 1012 // pageUrl = ostrcat("http://www.ilive.to", NULL, 0, 0); 1013 printf("streamer: %s\n", streamer); 1014 app = string_resub("/edge/", "\0", streamer, 0); 1015 1016 app = oregex(".*(/edge/) .*", streamer); 1017 1018 app = ostrcat(streamer, NULL, 0, 0); 1019 url = string_resub("rtmp://", "/", app, 0); 1020 app = string_replace(url, "", app, 0); 1021 app = string_replace_all("rtmp:///", "", app, 1); 1022 } 1023 1024 while(ostrstr(tmpstr, "Set-Cookie:") != NULL) 1025 { 1026 tmpstr4 = string_resub("Set-Cookie:", ";", tmpstr, 0); 1027 1028 if(tmpstr4 != NULL) 1029 { 1030 tmpstr5 = ostrcat("Set-Cookie: ", tmpstr4, 0, 0); 1031 tmpstr5 = ostrcat(tmpstr5, ";", 1, 0); 1032 tmpstr = string_replace(tmpstr5, "", tmpstr, 1); 1033 tmpstr4 = ostrcat(tmpstr4, "; ", 1, 0); 1034 Cookie1 = ostrcat(Cookie1, tmpstr4, 1, 0); 1035 } 1036 free(tmpstr4), tmpstr4 = NULL; 1037 free(tmpstr5), tmpstr5 = NULL; 1038 } 1039 1040 debug(99, "tvtoast6_tmpstr%d check getJSON") 1041 1042 if(ostrstr(tmpstr, "getJSON(\"") != NULL) 1043 { 1044 debug(99, "tvtoast6_tmpstr%d found getJSON") 1045 1046 printf("found getJSON\n"); 1047 tmpurl = string_resub("getJSON(\"", "\"", tmpstr, 0); 1048 tmpurl = string_replace_all("//", "http://", tmpurl, 1); 1049 1050 printf("tmpurl: %s\n", tmpurl); 1051 tmphost = string_resub("http://", "/", tmpurl, 0); 1052 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 1053 tmppath = string_replace_all("http://", "", tmppath, 1); 1054 free(fid), fid = NULL; 1055 free(tmpstr), tmpstr = NULL; 1056 1057 free(send), send = NULL; 1058 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1); 1059 1060 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast6_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); 1061 // free(tmppath), tmppath = NULL; 1062 free(tmphost), tmphost = NULL; 1063 // free(tmpurl), tmpurl = NULL; 1064 1065 1066 token = string_resub("{\"token\":\"", "\"", tmpstr, 0); 1067 1068 streamurl1 = ostrcat(streamer, " app=", 0, 0); 1069 streamurl1 = ostrcat(streamurl1, app, 1, 0); 1070 streamurl1 = ostrcat(streamurl1, " playpath=", 1, 0); 1071 streamurl1 = ostrcat(streamurl1, playpath, 1, 0); 1072 streamurl1 = ostrcat(streamurl1, " swfUrl=", 1, 0); 1073 streamurl1 = ostrcat(streamurl1, swfUrl, 1, 0); 1074 streamurl1 = ostrcat(streamurl1, " live=1", 1, 0); 1075 streamurl1 = ostrcat(streamurl1, " timeout=15", 1, 0); 1076 streamurl1 = ostrcat(streamurl1, " token=", 1, 0); 1077 streamurl1 = ostrcat(streamurl1, token, 1, 0); 1078 // streamurl1 = ostrcat(streamurl1, " pageUrl=http://", 1, 0); 1079 // streamurl1 = ostrcat(streamurl1, tmphost, 1, 0); 1080 streamurl1 = ostrcat(streamurl1, " pageUrl=", 1, 0); 1081 streamurl1 = ostrcat(streamurl1, tmpurl, 1, 0); 1082 typemsg = ostrcat(tmphost, NULL, 0, 0); 1083 } 1084 else if(fid != NULL) 1085 { 1086 printf("found fid: %s\n", fid); 1087 tmpurl = string_resub("src=\"", "'", tmpstr, 0); 1088 1089 tmphost = string_resub("http://", "/", tmpurl, 0); 1090 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 1091 tmppath = string_replace_all("http://", "", tmppath, 1); 1092 tmppath = ostrcat(tmppath, fid, 1, 0); 1093 1094 //free(fid), fid = NULL; 1095 free(tmpstr), tmpstr = NULL; 1096 } 1097 else 1098 { 1099 printf("found no fid: %s\n", fid); 1100 streamurl1 = string_resub("streamer: \"", "\"", tmpstr, 0); 1101 if(streamurl1 != NULL) 1102 streamurl1 = string_replace_all("\\", "", streamurl1, 1); 1103 1104 if(streamurl1 == NULL) 1105 { 1106 free(tmppath), tmppath = NULL; 1107 free(tmphost), tmphost = NULL; 1108 free(tmpurl), tmpurl = NULL; 1109 tmpurl = string_resub("var url = '", "'", tmpstr, 0); 1110 1111 if(tmpurl == NULL) 1112 tmpurl = string_resub("src='", "'", tmpstr, 0); 1113 if(tmpurl == NULL) 1114 tmpurl = string_resub("src=\"", "\"", tmpstr, 0); 1115 1116 if(ostrstr(tmpstr, "<h1>This channel can only work in") != NULL) 1117 referer = string_resub("<h1>This channel can only work in <a href='", "'", tmpstr, 0); 1118 1119 free(tmpstr), tmpstr = NULL; 1120 tmphost = string_resub("http://", "/", tmpurl, 0); 1121 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 1122 tmppath = string_replace_all("http://", "", tmppath, 1); 1123 1124 free(referer), referer = NULL; 1125 1126 1127 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1); 1128 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast7_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); 1129 // free(tmppath), tmppath = NULL; 1130 // free(tmphost), tmphost = NULL; 1131 free(tmpurl), tmpurl = NULL; 1132 1133 1134 } 1135 1136 streamurl1 = string_resub("streamer: \"", "\"", tmpurl, 0); 1137 } 1138 } 1139 } 1140 else 1141 { 1142 printf("found www\n"); 1143 1144 free(tmppath), tmppath = NULL; 1145 free(tmphost), tmphost = NULL; 1146 free(tmpurl), tmpurl = NULL; 1147 tmpurl = string_resub("var url = '", "'", tmpstr, 0); 1148 free(tmpstr), tmpstr = NULL; 1149 1150 tmphost = string_resub("http://", "/", tmpurl, 0); 1151 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 1152 tmppath = string_replace_all("http://", "", tmppath, 1); 1153 } 1154 1155 if(ostrstr(tmpstr, "<h1>This channel can only work in") != NULL) 1156 { 1157 referer = string_resub("<h1>This channel can only work in <a href='", "'", tmpstr, 0); 1158 } 1159 1160 free(tmpstr), tmpstr = NULL; 1161 free(send), send = NULL; 1162 1163 tmpstr = gethttps(tmpurl, NULL, NULL, NULL, NULL, 1); 1164 1165 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast8_tmpstr", oitoa(incount), tmphost, tmppath, tmpstr); 1166 // free(tmppath), tmppath = NULL; 1167 // free(tmphost), tmphost = NULL; 1168 free(tmpurl), tmpurl = NULL; 1169 1170 1171 swfUrl = string_resub("<script type=\"text/javascript\" src=\"", "\"", tmpstr, 0); 1172 1173 if(ostrstr(tmpstr, "rtmpe://") != NULL) 1174 { 1175 streamurl = getrtmp(tmpstr, tmphost, tmppath, &typemsg, fid, incount); 1176 } 1177 1178 free(tmphost), tmphost = NULL; 1179 if(streamurl1 == NULL) 1180 streamurl1 = string_resub("file: \"", "\"", tmpstr, 0); 1181 1182 if(streamurl1 == NULL) 1183 { 1184 streamid = string_resub("stream=\"", "\"", tmpstr, 0); 1185 if(streamid != NULL) 1186 { 1187 tmpstr1 = string_resub("<div style=\"visibility:hidden;\">", "</body>", tmpstr, 0); 1188 tmpurl = string_resub("type=\"text/javascript\" src=\"", "\"", tmpstr1, 0); 1189 1190 tmphost = string_resub("http://", "/", tmpurl, 0); 1191 tmppath = string_replace_all(tmphost, "", tmpurl, 0); 1192 tmppath = string_replace_all("http://", "", tmppath, 1); 1193 1194 tmpstr = gethttp(tmphost, tmppath, 80, NULL, NULL, 10000, NULL, 0); 1195 1196 while(ostrstr(tmpstr, "\\") != NULL) 1197 { 1198 tmpstr1 = string_resub("\"", "\"", tmpstr, 0); 1199 tmpstr2 = string_replace_all("\\x", "%", tmpstr1, 0); 1200 1201 if(tmpstr2 != NULL) 1202 { 1203 htmldecode(tmpstr2, tmpstr2); 1204 1205 tmpstr3 = ostrcat("\"", tmpstr1, 0, 0); 1206 tmpstr3 = ostrcat(tmpstr3, "\"", 1, 0); 1207 1208 tmpstr4 = ostrcat("'", tmpstr2, 0, 0); 1209 tmpstr4 = ostrcat(tmpstr4, "'", 1, 0); 1210 1211 tmpstr = string_replace(tmpstr3, tmpstr4, tmpstr, 1); 1212 free(tmpstr1), tmpstr1 = NULL; 1213 free(tmpstr2), tmpstr2 = NULL; 1214 } 1215 else 1216 break; 1217 1218 free(tmpstr1), tmpstr1 = NULL; 1219 free(tmpstr2), tmpstr2 = NULL; 1220 free(tmpstr3), tmpstr3 = NULL; 1221 free(tmpstr4), tmpstr4 = NULL; 1222 } 1223 1224 1225 titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/tvtoast_tmpstr9", oitoa(incount), tmphost, tmppath, tmpstr); 1226 // free(tmppath), tmppath = NULL; 1227 // free(tmphost), tmphost = NULL; 1228 free(tmpurl), tmpurl = NULL; 1229 1230 1231 urlid = oregex(".*\\[(.*)\\]\\+stream.*", tmpstr); 1232 tokenid = oregex(".*securetoken:_0x.*\\[(.*)\\].*", tmpstr); 1233 pageurlid = oregex(".*abouttext:_0x.*\\[(.*)\\],width.*", tmpstr); 1234 1235 tmpstr1 = string_resub("[", "]", tmpstr, 0); 1236 int count2 = 0; 1237 struct splitstr* ret2 = NULL; 1238 ret2 = strsplit(tmpstr1, ",", &count2); 1239 1240 if(count2 > atoi(urlid)) url = string_resub("'", "'", ret2[atoi(urlid)].part, 0); 1241 if(count2 > atoi(tokenid)) token = string_resub("'", "'", ret2[atoi(tokenid)].part, 0); 1242 if(count2 > atoi(pageurlid)) pageurl = string_resub("'", "'", ret2[atoi(pageurlid)].part, 0); 1243 1244 printf("urlid: %s\n",urlid); 1245 printf("tokenid: %s\n",tokenid); 1246 printf("pageurlid: %s\n",pageurlid); 1247 printf("url: %s\n",url); 1248 printf("token: %s\n",token); 1249 printf("1pageurl: %s\n",pageurl); 1250 1251 free(ret2), ret2 = NULL; 1252 1253 //rtmpdump -r rtmpe://strm.ukcast.tv/redirect -y bhousaa0 --debug 1254 1255 cmd = ostrcat("rtmpdump -r ", NULL, 0, 0); 1256 cmd = ostrcat(cmd, url, 1, 0); 1257 cmd = ostrcat(cmd, streamid, 1, 0); 1258 cmd = ostrcat(cmd, " --debug > /tmp/tithek/rtmp.log 2>&1", 1, 0); 1259 system("rm -rf /tmp/tithek/rtmp.log"); 1260 1261 free(tmpstr), tmpstr = NULL; 1262 printf("cmd: %s\n",cmd); 1263 system(cmd); 1264 free(cmd),cmd = NULL; 1265 1266 tmpstr = command("cat /tmp/tithek/rtmp.log"); 1267 1268 streamip = string_resub("redirect, STRING:", ">", tmpstr, 0); 1269 strstrip(streamip); 1270 1271 free(tmpstr), tmpstr = NULL; 1272 1273 streamurl = ostrcat(streamip, NULL, 0, 0); 1274 streamurl = ostrcat(streamurl, " playpath=", 1, 0); 1275 streamurl = ostrcat(streamurl, streamid, 1, 0); 1276 // streamurl = ostrcat(streamurl, " swfUrl=http://b17014255105be61b178-d8c0dbd82389bad2adcb7a22d1883b64.r92.cf5.rackcdn.com/jwplayer.flash.swf live=1 pageUrl=http://envivo.pw/ token=OOG17t.x#K9Vh#|", 1, 0); 1277 1278 // streamurl = ostrcat(streamurl, " swfUrl=http://b17014255105be61b178-d8c0dbd82389bad2adcb7a22d1883b64.r92.cf5.rackcdn.com/jwplayer.flash.swf", 1, 0); 1279 streamurl = ostrcat(streamurl, " swfUrl=", 1, 0); 1280 streamurl = ostrcat(streamurl, swfUrl, 1, 0); 1281 streamurl = ostrcat(streamurl, " live=1", 1, 0); 1282 // streamurl = ostrcat(streamurl, " pageUrl=http://envivo.pw/", 1, 0); 1283 // streamurl = ostrcat(streamurl, pageUrl, 1, 0); 1284 streamurl = ostrcat(streamurl, " pageUrl=http://", 1, 0); 1285 streamurl = ostrcat(streamurl, pageurl, 1, 0); 1286 streamurl = ostrcat(streamurl, "/", 1, 0); 1287 // typemsg = ostrcat(pageurl, NULL, 0, 0); 1288 1289 streamurl = ostrcat(streamurl, " token=", 1, 0); 1290 streamurl = ostrcat(streamurl, token, 1, 0); 1291 1292 free(urlid), urlid = NULL; 1293 free(tokenid), tokenid = NULL; 1294 free(pageurlid), pageurlid = NULL; 1295 free(url), url = NULL; 1296 free(token), token = NULL; 1297 free(pageurl), pageurl = NULL; 1298 1299 } 1300 } 1301 else 1302 streamurl = ostrcat(streamurl1, NULL, 0, 0); 1303 1304 free(streamurl1), streamurl1 = NULL; 1305 //////////////////// 1306 } 1090 1307 1091 //////////////////// 1308 1092 title = ostrcat("Rtmpe Stream (", NULL, 0, 0);
Note: See TracChangeset
for help on using the changeset viewer.