Changeset 36127


Ignore:
Timestamp:
Nov 9, 2015, 2:02:45 AM (4 years ago)
Author:
obi
Message:

reset youtube to 36019

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/tithek/youtube.h

    r36087 r36127  
    2222{
    2323        debug(99, "link: %s", link);
    24         char* ip = NULL, *pos = NULL, *path = NULL, *tmppath = NULL, *streamurl = NULL, *title = NULL, *tmpstr = NULL, *murl = NULL, *sig = NULL, *pic = NULL;
     24        char* ip = NULL, *pos = NULL, *path = NULL, *tmppath = NULL, *streamurl = NULL, *title = NULL, *tmpstr = NULL, *murl = NULL, *sig = NULL, *pic = NULL, *tmplink = NULL;
    2525
    2626        ip = string_replace("http://", "", (char*)link, 0);
     
    3636        tmppath = string_replace_all("watch?v=", "get_video_info?&video_id=", tmppath, 1);
    3737
    38 
    39         char* tmplink = ostrcat(link, NULL, 0, 0);
     38        tmplink = ostrcat(link, NULL, 0, 0);
    4039        tmplink = string_replace_all("watch?v=", "get_video_info?&video_id=", tmplink, 1);
    4140        tmplink = string_replace_all("/youtu.be", "/www.youtube.com", tmplink, 1);
     
    4645grep code:
    4746<div id="spxliveplayer"><iframe frameborder="0" width="640px" height="360px" scrolling="no" src="http://www.youtube.com/embed/SjMEn0d6ByU" id="spxliveiframe" ></iframe></div>
     47
     48and get to youtube
    4849*/
    4950
    50         tmpstr = gethttps(tmplink, NULL, NULL, NULL, NULL, NULL, 1);
     51        tmpstr = gethttps(tmplink, NULL, NULL, NULL, NULL, 1);
    5152        writesys("/var/usr/local/share/titan/plugins/tithek/youtube_tmpstr", tmpstr, 0);
    5253        free(tmplink), tmplink = NULL;
    53 
    54 //13:50:32 T:2532  NOTICE: 'GET /youtube/v3/channels?part=snippet%2CcontentDetails%2CbrandingSettings&id=UC_fV2pzmw2SujuQgIm6YcbQ%2CUCWp1qqITrK2hQBpFTmE9uVg%2CUCClNRixXlagwAd--5MwJKCw%2CUCz6Lv-YT2Fjhi3GyXdXt4Vw%2CUC0g5OdpoCTfpHUelY9PLWSQ%2CUCXJDX1KK6t121Z9FLhu5o2A%2CUCboe4JAAUOI-OzKBj_pkYFg%2CUCT-_4GqC-yLY1xtTHhwY0hA%2CUCsW36751Gy-EAbHQwe9WBNw%2CUC1fIyfhQtm1fSljyKBf2uKA%2CUCy-dXLczRuq-ZtuWmUo52PA%2CUCq-Fj5jknLsUf-MWSy4_brA%2CUCe2r4-wNZjYmQhHrYAR2WUA%2CUC-v9ZU8TO8chuAOsh3UO-gQ%2CUCa6vGFO9ty8v5KZJXQxdhaw%2CUC5zGJZpxeZPFcds5gFcDE7Q%2CUC0y2acrGZ3NH-3ycSGYuIPQ%2CUCqyYNNx60mBgvNKKR5VhUCA%2CUCCgDVqiPU10shxzmwkMwJ6A%2CUCFeUyPY6W8qX8w2o6oSiRmw%2CUCl0kP-Cfe-GGic7Ilnk-u_Q%2CUCXkQVG6OdyB2ct4xOOZjmPQ%2CUCu17Sme-KE87ca9OTzP0p7g%2CUC2nZMhZ2qG5-xpqb440WLYg%2CUCYdIDs5a3Pt-o4SiD-ih24g&key=AIzaSyBAdxZCHbeJwnQ7dDZQJNfcaF46MdqJ24E HTTP/1.1\r\nHost: www.googleapis.com\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.36 Safari/537.36\r\nConnection: close\r\nAccept-Encoding: gzip, deflate\r\n\r\n'
    55 
    56 //      tmpstr = gethttps(link, NULL, NULL, NULL, NULL, NULL, 1);
    57 //      writesys("/var/usr/local/share/titan/plugins/tithek/youtube_tmpstr", tmpstr, 0);
    58 
    59 //http://r7---sn-h0j7snel.googlevideo.com/videoplayback?source=youtube&gcr=de&ratebypass=yes&upn=32kjep7VPuc&initcwndbps=688750&expire=1443472674&sver=3&key=yt6&mn=sn-h0j7snel&mm=31&ip=95.91.6.76&sparams=dur%2Cgcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Csource%2Cupn%2Cexpire&pl=17&mv=m&mt=1443450913&ms=au&mime=video%2Fmp4&dur=249.173&id=o-APp6mA0M_837ohVW8yheCE2x2Ajd9KZ5GhoFWpMykdLR&ipbits=0&itag=22&fexp=9407155%2C9408508%2C9408710%2C9409069%2C9415365%2C9415485%2C9416023%2C9416729%2C9418448%2C9419484%2C9420215%2C9420348%2C9420818%2C9420928%2C9421013&lmt=1429610403267549&signature=
    6054
    6155//      if(flag == 1)
     
    7771                        struct menulist* mlist = NULL, *mbox = NULL;
    7872                        int count = 0, i = 0;
    79                         tmpstr = ostrcat(tmpstr, "&", 1, 0);
    80 //                      tmpstr = string_resub("url_encoded_fmt_stream_map=","&",tmpstr,0);
     73                        tmpstr = ostrcat(tmpstr,"&",0,0);
     74                        tmpstr = string_resub("url_encoded_fmt_stream_map=","&",tmpstr,0);
    8175
    8276                        if(tmpstr != NULL)
    8377                        {
    84                                 htmldecode(tmpstr,tmpstr);
    85                                 htmldecode(tmpstr,tmpstr);
    86                                 htmldecode(tmpstr,tmpstr);
    87                                 htmldecode(tmpstr,tmpstr);
    88                                 htmldecode(tmpstr,tmpstr);
    89                                 tmpstr = string_replace_all("\n", " ", tmpstr, 1);
    90                                 tmpstr = string_replace_all("&url=", "\n", tmpstr, 1);
    91 
    92                                 ret1 = strsplit(tmpstr,"\n",&count);
     78                                ret1 = strsplit(string_decode(tmpstr,0),",",&count);
    9379
    9480                                for(i = 0; i < count; i++)
     
    9985                                                ret1[i].part = ostrcat(ret1[i].part,"&",0,0);
    10086                                               
    101                                                 murl = string_resub("url=", "&", ret1[i].part, 0);
    102                                                 sig = string_resub("sig=", "&", ret1[i].part, 0);
    103                                                 if(sig == NULL)
    104                                                         sig = string_resub("s=", "&", ret1[i].part, 0);
    105 
    106                                                 streamurl = ostrcat(ret1[i].part, NULL, 0, 0);
    107                                                 streamurl = string_replace_all(",itag=", "\0", streamurl, 1);
    108 
    109                                                 if(streamurl != NULL)
    110                                                 {
     87                                                murl = string_resub("url=","&",ret1[i].part,0);
     88                                                sig = string_resub("sig=","&",ret1[i].part,0);
     89                                               
     90                                                free(streamurl), streamurl = NULL;
     91//                                              if(murl != NULL && sig != NULL)
     92                                                if(murl != NULL)
     93                                                {                                       
     94                                                        streamurl = ostrcat(murl, NULL, 0, 0);
     95                                                        streamurl = ostrcat(streamurl, "&signature=", 1, 0);
     96                                                        streamurl = ostrcat(streamurl, sig, 1, 0);
     97                                                        streamurl = string_decode(streamurl,0);
     98                                                                                                                       
    11199                                                        if(ostrstr(ret1[i].part, "itag=85") != NULL)
    112100                                                        {
     
    285273
    286274                char* tmpstr = NULL;
    287                 tmpstr = gethttps(url, NULL, NULL, NULL, NULL, NULL, 1);               
    288 //              tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
     275                tmpstr = gethttps(url, NULL, NULL, NULL, NULL, 1);             
    289276                writesys("/var/usr/local/share/titan/plugins/tithek/tmpstr1", tmpstr, 0);
    290 printf("ALLE\n");
    291277
    292278                tmpstr = stringreplacechar(tmpstr, '\n', ' ');
     
    296282                tmpstr = string_replace_all("media:thumbnail", "\nthumbnail", tmpstr, 1);
    297283                writesys("/var/usr/local/share/titan/plugins/tithek/tmpstr2", tmpstr, 0);
    298 /*
    299 
    300 //12:39:28 T:11340  NOTICE: 'GET /youtube/v3/videos?part=snippet%2CcontentDetails&id=eOxPED0TunI%2CsojYfBmdvlE%2Cj-ocHL0eudY%2CHQBia-CfqbE%2CmHLwXQoG4CU%2Cw5VFOKKAbQQ%2CvnoQ5lkBVhU%2CeocCPDxKq1o%2ChSjIz8oQuko%2CJDKGWaCglRM%2CbZsqdTrr1eM%2CyTCDVfMz15M%2CHq2DINl2MxI%2CnB2Hsh1XqyA%2C41aGCrXM20E%2Cuc8OpUnUNNU%2Cv4UkD7U88NQ%2CAlMa52Xkoj0%2CocDlOD1Hw9k%2CG6ZLZQGydPc%2CxXvBkwihOE8%2CNJWIbIe0N90%2CwCqs2uJWwZs%2CPl-TCZSRhy4%2C0TDTEEXZtLs%2CXIId4uESVeA%2ClHSl-yz5FqA%2CRzriJpYiGjw%2CjT5RwB5ML30%2C5r9vdqAFCY4%2CzsmUOdmm02A%2C8WmZW7JB3GY%2C3NrNWISh5CE%2CeDtMxamBxI8%2CBR4yQFZK9YM%2CRAcNZo7-f0g%2CXjVNlG5cZyQ%2CasaCQOZpqUQ%2CWWYLM9opelw%2CqOfkpu6749w%2CBJLWNWDqK-k%2COpQFFLBMEPI%2Cm-6ir-gFpbA%2C3stsDXki__U%2C57KVfhWcEk0%2CFJfFZqTlWrQ%2CSNjFTxaeWug%2CumM9Ls0SaiU%2Cw7JRWHCKkIY%2C6lyq05OWuVM&key=AIzaSyBAdxZCHbeJwnQ7dDZQJNfcaF46MdqJ24E HTTP/1.1\r\nHost: www.googleapis.com\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.36 Safari/537.36\r\nConnection: close\r\nAccept-Encoding: gzip, deflate\r\n\r\n'
    301 /youtube/v3/videos?part=snippet%2CcontentDetails
    302 &id=
    303 eOxPED0TunI
    304 %2
    305 CsojYfBmdvlE
    306 %2
    307 Cj-ocHL0eudY
    308 %2
    309 CHQBia-CfqbE
    310 %2
    311 CmHLwXQoG4CU
    312 %2
    313 Cw5VFOKKAbQQ%2CvnoQ5lkBVhU%2CeocCPDxKq1o%2ChSjIz8oQuko%2CJDKGWaCglRM%2CbZsqdTrr1eM%2CyTCDVfMz15M%2CHq2DINl2MxI%2CnB2Hsh1XqyA
    314 %2C41aGCrXM20E%2Cuc8OpUnUNNU%2Cv4UkD7U88NQ%2CAlMa52Xkoj0%2CocDlOD1Hw9k%2CG6ZLZQGydPc%2CxXvBkwihOE8%2CNJWIbIe0N90%2CwCqs2uJWwZs%2CPl-TCZSRhy4
    315 %2C0TDTEEXZtLs%2CXIId4uESVeA%2ClHSl-yz5FqA%2CRzriJpYiGjw%2CjT5RwB5ML30%2C5r9vdqAFCY4%2CzsmUOdmm02A%2C8WmZW7JB3GY%2C3NrNWISh5CE%2CeDtMxamBxI8
    316 %2CBR4yQFZK9YM%2CRAcNZo7-f0g%2CXjVNlG5cZyQ%2CasaCQOZpqUQ%2CWWYLM9opelw%2CqOfkpu6749w%2CBJLWNWDqK-k
    317 %2COpQFFLBMEPI%2Cm-6ir-gFpbA
    318 %2C3stsDXki__U%2C57KVfhWcEk0%2CFJfFZqTlWrQ%2CSNjFTxaeWug%2CumM9Ls0SaiU%2Cw7JRWHCKkIY%2C6lyq05OWuVM
    319 
    320 &key=AIzaSyBAdxZCHbeJwnQ7dDZQJNfcaF46MdqJ24E HTTP/1.1\r\nHost: www.googleapis.com\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.36 Safari/537.36\r\nConnection: close\r\nAccept-Encoding: gzip, deflate\r\n\r\n'
    321 
    322 "title": "
    323 "videoId": "
    324 "url": "
    325 */
     284
    326285                int count = 0;
    327286                int incount = 0;
     
    329288                struct splitstr* ret1 = NULL;
    330289                ret1 = strsplit(tmpstr, "\n", &count);
    331 //part="etag": "\"jOXstHOM20qemPbHbyzf7ztZ7rI/zJExHKkQXAGmI7-mKIkjbmndgJ0\"",    "id": {     "kind": "youtube#video",     "videoId": "57KVfhWcEk0"    },    "snippet": {     "publishedAt": "2015-09-19T02:06:39.000Z",     "channelId": "UCwehWhlhepFE8mFdlC1ebAw",     "title": "Pink - Mindless Self Indulgence FULL ALBUM",     "description": "JIMMY SAYS TO BUY THE FUCKING ALBUM Tracklist: 01. Personal Jesus 02. This Hurts 03. Be Like Superman 04. Memory Of Heaven 05. Vanity 06. Married ...",     "thumbnails": {      "default": {       "url": "https://i.ytimg.com/vi/57KVfhWcEk0/default.jpg"      },      "medium": {       "url": "https://i.ytimg.com/vi/57KVfhWcEk0/mqdefault.jpg"      },      "high": {       "url": "https://i.ytimg.com/vi/57KVfhWcEk0/hqdefault.jpg"      }     },     "channelTitle": "",     "liveBroadcastContent": "none"    }   }  ] }
    332290
    333291                if(ret1 != NULL)
     
    339297                                if(ostrstr(ret1[i].part, "videoId") != NULL)
    340298                                {
    341 //                                      pic = oregex(".*thumbnail url=\'(http://i.ytimg.com/vi/.*/.*.jpg).*media:title.*", ret1[i].part);
    342 //                                      id = oregex(".*thumbnail url=\'http://i.ytimg.com/vi/(.*)/.*.jpg.*media:title.*", ret1[i].part);
    343 //                                      title = oregex(".*<media:title type='plain'>(.*)</media:title>.*", ret1[i].part);
    344 
    345299                                        pic = string_resub("\"url\": \"", "\"", ret1[i].part, 0);
    346300                                        id = string_resub("\"videoId\": \"", "\"", ret1[i].part, 0);
     
    353307                                        int rcret = waitrc(NULL, 10, 0);
    354308                                        if(rcret == getrcconfigint("rcexit", NULL)) break;
    355 //www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails&id=eOxPED0TunI%2CsojYfBmdvlE%2Cj-ocHL0eudY%2CHQBia-CfqbE%2CmHLwXQoG4CU%2Cw5VFOKKAbQQ%2CvnoQ5lkBVhU%2CeocCPDxKq1o%2ChSjIz8oQuko%2CJDKGWaCglRM%2CbZsqdTrr1eM%2CyTCDVfMz15M%2CHq2DINl2MxI%2CnB2Hsh1XqyA%2C41aGCrXM20E%2Cuc8OpUnUNNU%2Cv4UkD7U88NQ%2CAlMa52Xkoj0%2CocDlOD1Hw9k%2CG6ZLZQGydPc%2CxXvBkwihOE8%2CNJWIbIe0N90%2CwCqs2uJWwZs%2CPl-TCZSRhy4%2C0TDTEEXZtLs%2CXIId4uESVeA%2ClHSl-yz5FqA%2CRzriJpYiGjw%2CjT5RwB5ML30%2C5r9vdqAFCY4%2CzsmUOdmm02A%2C8WmZW7JB3GY%2C3NrNWISh5CE%2CeDtMxamBxI8%2CBR4yQFZK9YM%2CRAcNZo7-f0g%2CXjVNlG5cZyQ%2CasaCQOZpqUQ%2CWWYLM9opelw%2CqOfkpu6749w%2CBJLWNWDqK-k%2COpQFFLBMEPI%2Cm-6ir-gFpbA%2C3stsDXki__U%2C57KVfhWcEk0%2CFJfFZqTlWrQ%2CSNjFTxaeWug%2CumM9Ls0SaiU%2Cw7JRWHCKkIY%2C6lyq05OWuVM&key=AIzaSyBAdxZCHbeJwnQ7dDZQJNfcaF46MdqJ24E
     309
    356310                                        if(id != NULL)
    357311                                        {
     
    363317                                                line = ostrcat(line, "#http://www.youtube.com/get_video_info?&video_id=", 1, 0);
    364318                                                line = ostrcat(line, id, 1, 0);
    365                                                                                                
    366319//                                              line = ostrcat(line, "#http://www.youtube.com/get_video_info?el=leanback&cplayer=UNIPLAYER&cos=Windows&height=1080&cbr=Chrome&hl=en_US&cver=4&ps=leanback&c=TVHTML5&video_id=", 1, 0);
    367320//                                              line = ostrcat(line, id, 1, 0);
    368321//                                              line = ostrcat(line, "&cbrver=40.0.2214.115&width=1920&cosver=6.1&ssl_stream=1", 1, 0);
    369 
    370 //www.youtube.com/get_video_info?el=leanback&cplayer=UNIPLAYER&cos=Windows&height=1080&cbr=Chrome&hl=en_US&cver=4&ps=leanback&c=TVHTML5&video_id=yTCDVfMz15M&cbrver=40.0.2214.115&width=1920&cosver=6.1&ssl_stream=1
    371 
    372 //                                              line = ostrcat(line, "#https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails&id=", 1, 0);
    373 //                                              line = ostrcat(line, id, 1, 0);
    374 //                                              line = ostrcat(line, "&key=AIzaSyBAdxZCHbeJwnQ7dDZQJNfcaF46MdqJ24E", 1, 0);
    375322                                                line = ostrcat(line, "#", 1, 0);
    376323                                                line = ostrcat(line, pic, 1, 0);
Note: See TracChangeset for help on using the changeset viewer.