| View previous topic :: View next topic |
| Author |
Message |
duarteper Voice
Joined: 06 Dec 2012 Posts: 12
|
Posted: Sun Jan 06, 2013 12:57 pm Post subject: youtube search tcl error |
|
|
Hello everyone
this tcl doesent work wen i type
!yt Video_here
| Code: |
bind pub -|- !yt yt_search
###
### youtube getlink v 0.1
###
### just a simple script that fetches the first
### result from a youtube search, giving you
### the link, title and description for the primary
### result
###
### nothing can be set here
### if you know tcl please edit to fit your need
### grtz hwk
### contact me at: lowraider1@gmail.com
package require http
proc yt_search {nick uhost hand chan args} {
regsub -nocase -all " " $args "+" yt(squery)
set yt(surl) "http://youtube.com/results?search_query=$yt(squery)&search_type="
http::config -useragent mozilla
set urltok [http::geturl $yt(surl) -timeout 20000]
set yt(rpage) [http::data $urltok]
http::cleanup $urltok
regsub -nocase -all (<b>|</b>|\t|<i>|</i>) $yt(rpage) "" rpage
regexp -line -- {<div class="vlshortTitle">\n(.*)\n</div>} $rpage -> yt(infos)
regexp {<a href="(.*)" title} $yt(infos) -> yt(link)
regexp {>(.*)</a>} $yt(infos) -> yt(title)
regexp -line -- {<div class="vldesc">\n(.*)\n</div>\n</div>} $rpage -> yt(desc)
if {[string match -nocase "*No Videos found*" $rpage] || ![info exists yt(title)]} {puthelp "privmsg $chan :Nothing found"} else {
puthelp "privmsg $chan :LINK: http://youtube.com$yt(link) | Title: $yt(title) | Description: $yt(desc)"}
}
putlog "youtube getlink v 0.1 by hwk loaded"
|
|
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Mon Jan 21, 2013 8:31 pm Post subject: |
|
|
Use this page http://forum.egghelp.org/viewtopic.php?t=10215 to get all the informations on hw to enable .tcl command and see if the script is giving any error when you trigger the main command.
So what you need to do is:
1. Activate .tcl command from eggdrop.conf
2. Use /ctcp botnick chat
3. Use .tcl $errorInfo (copy paste here the output here)
Then we will see if there is an actual error _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Jan 22, 2013 1:39 am Post subject: |
|
|
Looks like they've changed (again?) the layout thus giving error:
| Quote: |
Tcl error: can't read "yt(infos)": no such element in array
|
made by:
| Code: |
regexp -line -- {<div class="vlshortTitle">\n(.*)\n</div>} $rpage -> yt(infos)
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|