Mercurial > hg > egg-tcls
changeset 299:1ff281e821a3
urllog: Make rasiatube hack configurable.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 27 Jan 2015 08:22:36 +0200 |
parents | 67e43d6f5c41 |
children | 2a9ee3f68225 |
files | config.urllog.example urllog.tcl |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/config.urllog.example Tue Jan 27 08:21:00 2015 +0200 +++ b/config.urllog.example Tue Jan 27 08:22:36 2015 +0200 @@ -55,6 +55,10 @@ # (You probably want this enabled.) set urllog_extra_checks 1 +### Enable "rasiatube" hack that de-mangles rasiatube links +set urllog_rasiatube_hack 1 + + ### ### Search related settings
--- a/urllog.tcl Tue Jan 27 08:21:00 2015 +0200 +++ b/urllog.tcl Tue Jan 27 08:22:36 2015 +0200 @@ -370,7 +370,8 @@ #------------------------------------------------------------------------- proc urllog_check_url {urlStr urlNick urlHost urlChan} { - global urllog_encoding http_tls_support urlmsg_errorgettingdoc urllog_extra_checks + global urllog_encoding http_tls_support urlmsg_errorgettingdoc + global urllog_extra_checks urllog_rasiatube_hack ### Does the URL already exist? if {![urllog_exists $urlStr $urlNick $urlHost $urlChan]} { @@ -483,7 +484,7 @@ } # Rasiatube hack - if {[string match "*/rasiatube/view*" $urlStr]} { + 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