Changeset 32877
- Timestamp:
- 02/05/15 19:30:01 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/youtube.h
r29555 r32877 261 261 262 262 char* tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); 263 // writesys("/var/usr/local/share/titan/plugins/tithek/tmpstr1", tmpstr, 0); 264 263 265 tmpstr = string_replace_all("media:thumbnail", "\nthumbnail", tmpstr, 1); 266 // writesys("/var/usr/local/share/titan/plugins/tithek/tmpstr2", tmpstr, 0); 264 267 265 268 int count = 0; … … 274 277 for(i = 0; i < max; i++) 275 278 { 279 debug(99, "ret1[i].part=%s", ret1[i].part); 276 280 if(ostrstr(ret1[i].part, "http://i.ytimg.com/vi/") != NULL) 277 281 { 278 pic = oregex(".*thumbnail url=\'(http://i.ytimg.com/vi/.*/0.jpg).*", ret1[i].part); 279 id = oregex(".*thumbnail url=\'http://i.ytimg.com/vi/(.*)/0.jpg.*", ret1[i].part); 282 pic = oregex(".*thumbnail url=\'(http://i.ytimg.com/vi/.*/.*.jpg).*media:title.*", ret1[i].part); 283 id = oregex(".*thumbnail url=\'http://i.ytimg.com/vi/(.*)/.*.jpg.*media:title.*", ret1[i].part); 284 title = oregex(".*<media:title type='plain'>(.*)</media:title>.*", ret1[i].part); 285 286 debug(99, "title=%s", title); 287 debug(99, "id=%s", id); 288 debug(99, "pic=%s", pic); 289 280 290 int rcret = waitrc(NULL, 10, 0); 281 291 if(rcret == getrcconfigint("rcexit", NULL)) break; … … 286 296 ip = ostrcat("www.youtube.com", NULL, 0, 0); 287 297 path = ostrcat("watch?v=", id, 0, 0); 288 title = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);289 title = string_resub("<meta name=\"title\" content=\"", "\">", title, 0);290 298 291 299 line = ostrcat(line, title, 1, 0); 292 // line = ostrcat(line, "#http://www.youtube.com/watch?v=", 1, 0);293 300 line = ostrcat(line, "#http://www.youtube.com/get_video_info?&video_id=", 1, 0); 294 301 line = ostrcat(line, id, 1, 0);
Note: See TracChangeset
for help on using the changeset viewer.