comparison urllog.tcl @ 118:e5f2961a6145

urllog: Improve rasiatube URL de-mangling.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 13 Oct 2011 20:14:13 +0300
parents d40a0f3af7ab
children 939d2338c842
comparison
equal deleted inserted replaced
117:d40a0f3af7ab 118:e5f2961a6145
545 } 545 }
546 546
547 # Rasiatube hack 547 # Rasiatube hack
548 if {[string match "*/rasiatube/view*" $urlStr]} { 548 if {[string match "*/rasiatube/view*" $urlStr]} {
549 set rasia 0 549 set rasia 0
550 set umatches [regexp -nocase -inline -- "<link rel=\"video_src\"\.\*\?file=(http://\[^&\]+)&" $udata] 550 if {[regexp -nocase -- "<link rel=\"video_src\"\.\*\?file=(http://\[^&\]+)&" $udata umatches utmp]} {
551 if {[llength $umatches] > 0} { 551 regsub -all "\/v\/" $utmp "\/watch\?v=" urlStr
552 set urlStr [lindex $umatches 1]
553 regsub -all "\/v\/" $urlStr "\/watch\?v=" urlStr
554 set rasia 1 552 set rasia 1
555 } else { 553 } else {
556 set umatches [regexp -nocase -inline -- "SWFObject.\"(\[^\"\]+)\", *\"flashvideo" $udata] 554 if {[regexp -nocase -- "SWFObject.\"(\[^\"\]+)\", *\"flashvideo" $udata umatches utmp]} {
557 if {[llength $umatches] > 0} { 555 regsub "http:\/\/www.dailymotion.com\/swf\/" $utmp "http:\/\/www.dailymotion.com\/video\/" urlStr
558 set urlStr [lindex $umatches 1]
559 regsub "http:\/\/www.dailymotion.com\/swf\/" $urlStr "http:\/\/www.dailymotion.com\/video\/" urlStr
560 set rasia 1 556 set rasia 1
561 } 557 }
562 } 558 }
563 559
564 if {$rasia != 0} { 560 if {$rasia != 0} {