Mercurial > hg > egg-tcls
changeset 471:6ea3977f4460
Merge.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 26 Oct 2018 09:38:33 +0300 |
parents | 2faf2eb18f26 (diff) 6c999a7ac6d9 (current diff) |
children | 04b629038256 |
files | |
diffstat | 1 files changed, 6 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/urllog.tcl Sun Jul 01 18:57:00 2018 +0300 +++ b/urllog.tcl Fri Oct 26 09:38:33 2018 +0300 @@ -344,12 +344,6 @@ return 0 } - ### Is it a http or ftp url? - if {$urlProto != "http" && $urlProto != "https" && $urlProto != "ftp"} { - urllog_log "Broken URL from $urlNick: ($urlStr) UNSUPPORTED protocol class ($urlProto)." - return 0 - } - ### Check the Top Level Domain (TLD) validity if {$urllog_check_tld != 0 && $u_checktld != 0} { set u_sane [lindex [split $urlHostName "."] end] @@ -495,7 +489,12 @@ # Get the document title, if any set urlTitle "" - set tmpRes [regexp -nocase -- "<title.\*\?>(.\*\?)</title>" $udata umatches urlTitle] + + if {[regexp -nocase -- "<meta name=\"twitter:title\" content=\"(.\*\?)\"\/>" $udata umatches urlTitle]} { + # ... + } elseif {[regexp -nocase -- "<title.\*\?>(.\*\?)</title>" $udata umatches urlTitle]} { + # ... + } # If facebook, get meta info if {[regexp -nocase -- "(http|https):\/\/www.facebook.com" $urlStr]} { @@ -518,24 +517,6 @@ set urlTitle [string trim $utmp] } - # Rasiatube hack - if {$urllog_rasiatube_hack != 0 && [string match "*/rasiatube/view*" $urlStr]} { - set rasia 0 - if {[regexp -nocase -- "<link rel=\"video_src\"\.\*\?file=(http://\[^&\]+)&" $udata umatches utmp]} { - regsub -all "\/v\/" $utmp "\/watch\?v=" urlStr - set rasia 1 - } else { - if {[regexp -nocase -- "SWFObject.\"(\[^\"\]+)\", *\"flashvideo" $udata umatches utmp]} { - regsub "http:\/\/www.dailymotion.com\/swf\/" $utmp "http:\/\/www.dailymotion.com\/video\/" urlStr - set rasia 1 - } - } - if {$rasia != 0} { - urllog_log "RasiaTube mangler: $urlStr" - urllog_verb_msg $urlNick $urlChan "Korjataan haiseva rasiatube-linkki: $urlStr" - } - } - # Check if the URL already exists, just in case we had some redirects if {[urllog_exists $urlStr $urlNick $urlHost $urlChan]} { urllog_addurl $urlStr $urlNick $urlHost $urlChan $urlTitle