Changeset 34109


Ignore:
Timestamp:
04/22/15 17:20:23 (9 years ago)
Author:
obi
Message:

[tithek] solarmovie optimize hoster listing

File:
1 edited

Legend:

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

    r34102 r34109  
    361361//                      tmpstr = command("cat /tmp/tithek/get_zcat");
    362362                        char* tmpcat = string_resub("<tbody>", "</tbody>", tmpstr, 0);
     363//new
     364                        stringreplacechar(tmpcat, '\n', ' ');
     365                        string_strip_whitechars(tmpcat);
     366                        tmpcat = string_replace_all("td class=\"qualit", "\ntd class=\"qualit", tmpcat, 1);
     367//end
     368                        int count = 0;
     369                        struct splitstr* ret1 = NULL;
     370                        ret1 = strsplit(tmpcat, "\n", &count);
     371                        int max = count;
     372                        int i = 0, incount = 0;
     373                        for(i = 0; i < max; i++)
     374                        {
     375                                debug(99, "ret1[i].part: %s", ret1[i].part);
     376
     377                                id = string_resub("/link/show/", "/", ret1[i].part, 0);
     378                                debug(99, "id: %s", id);
     379
     380                                if(id == NULL) continue;
     381
     382                                quality = string_resub("qualityCell js-link-format\" style=\"text-transform: uppercase;\">", "</td>", ret1[i].part, 0);
     383                                update = string_resub("oddCell\" style=\"color: #59636a;\">", "</td>", ret1[i].part, 0);
     384                                string_remove_whitechars(quality);
     385                                strstrip(quality);
     386 
     387                                tmphname = oregex(".*<a href=\"/link/show/.*> (.*) </a>.*", ret1[i].part);
     388                                debug(99, "tmphname: %s", tmphname);
     389                                   
     390                                string_remove_whitechars(tmphname);
     391                                strstrip(tmphname);
     392
     393                                pichname = ostrcat(tmphname, NULL, 0, 0);
     394                                string_tolower(pichname);
     395                                pichname = stringreplacecharonce(pichname, '.', '\0');
     396
     397                                int type = 43;
     398                                debug(99, "(%d/\?\?) %s id: %s quality: %s update: %s pic: %s", i, tmphname, id, quality, update, pichname);
     399
     400                                incount += 1;
     401                                line = ostrcat(line, tmphname, 1, 0);
     402                                if(quality != NULL)
     403                                {
     404                                        line = ostrcat(line, " (", 1, 0);                                       
     405                                        line = ostrcat(line, quality, 1, 0);                                   
     406                                        line = ostrcat(line, ")", 1, 0);                                       
     407                                }
     408                                if(update != NULL)
     409                                {
     410                                        line = ostrcat(line, " (", 1, 0);                                       
     411                                        line = ostrcat(line, update, 1, 0);                                     
     412                                        line = ostrcat(line, ")", 1, 0);                                       
     413                                }                                       
     414                                line = ostrcat(line, "#", 1, 0);
     415                                line = ostrcat(line, "http://www.solarmovie.is/link/play/", 1, 0);
     416                                line = ostrcat(line, id, 1, 0);
     417                                line = ostrcat(line, "#", 1, 0);
     418                                line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0);
     419                                line = ostrcat(line, pichname, 1, 0);
     420                                line = ostrcat(line, ".jpg#solarmovie_", 1, 0);
     421                                line = ostrcat(line, pichname, 1, 0);
     422                                line = ostrcat(line, ".jpg#Solarmovie - ", 1, 0);
     423                                line = ostrcat(line, title, 1, 0);
     424                                line = ostrcat(line, "#", 1, 0);
     425                                line = ostrcat(line, oitoa(type), 1, 0);
     426                                line = ostrcat(line, "\n", 1, 0);
     427                                free(hname), hname = NULL;
     428                                                       
     429                                free(pichname), pichname = NULL;               
     430                                free(tmphname), tmphname = NULL;
     431                                free(id), id = NULL;
     432                                debug(99, "#######################################################");
     433
     434                        }
     435                               
     436/*
     437//                      string_strip_whitechars(tmpstr);
     438                        writesys("/var/usr/local/share/titan/plugins/tithek/1solarmovie8_tmpcat", tmpcat, 0);
    363439       
    364440                        char* ptmpcat = ostrstr(tmpcat, "<td class=\"qualit");
     441                        writesys("/var/usr/local/share/titan/plugins/tithek/1solarmovie8_ptmpcat", ptmpcat, 0);
     442
    365443                        int i = 0, incount = 0;
    366444                        while(ptmpcat != NULL)
     
    368446                                i++;
    369447                                tmpstr1 = ostrcat(tmpstr1, string_resub("<td class=\"qualit", "<div class=\"linkDetails\">", ptmpcat, 0), 1, 1);
     448                        writesys("/var/usr/local/share/titan/plugins/tithek/1solarmovie8_tmpstr1", tmpstr1, 0);
     449//return;
    370450                                ptmpcat += 5;
    371451                                ptmpcat = ostrstr(ptmpcat, "<td class=\"qualit");
     
    373453                                if(ptmpcat != NULL)
    374454                                {
    375 //                                      id = string_resub("<a href=\"/link/show/", "/", tmpstr1, 0);
    376 //                                      id = oregex(".*/link/show/(.*)/\">.*", tmpstr1);
    377 //                                      id = oregex(".*/link/show/(.*)/.*\">.*", tmpstr1);
    378455                                        char* tmpid = oregex(".*<a href=\"/link/(.*)/.*", tmpstr1);
    379456//                                      debug(99, "tmpid: %s", tmpid);
     
    389466                                        strstrip(quality);
    390467                                       
    391 //                                      tmphname = oregex(".*/\">(.*)</a>.*", tmpstr1);
    392468                                        tmphname = oregex(".*<a href=\"/link/show/.*\">(.*)</a>.*", tmpstr1);
    393469
     
    436512                                }
    437513                        }
     514*/
    438515                        free(tmpcat); tmpcat = NULL;
    439516                }       
Note: See TracChangeset for help on using the changeset viewer.