This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Support & discussion of released scripts, and announcements of new releases.
tigrato
Voice
Posts: 22 Joined: Sat Jul 04, 2009 7:46 am
Post
by tigrato » Fri Aug 27, 2010 9:53 am
I tried to update the Mookie youtube script but something is wrong ... The script does not work.
Can anyone help?
Code: Select all
### YouTube Searching script. v0.1
### Made by Mookie
### Contact me at Efnet for more information or suggestions
### V0.3 Fixed + added spam protection
package require http
### Settings ###
set youtube(timeout) "600000" ;# Youtube geturl timeout. (better leave this default)
set youtube(results) "5" ;# Results to display
set youtube(trigger) "!youtube" ;# Search trigger
set youtube(spam) "10" ;# Spam protection in seconds
#########################################################
## Don't edit below unless you know what you're doing. ##
#########################################################
bind pub - $::youtube(trigger) youtube
proc youtube {nick uhost hand chan arg} {
if {[info exists ::checks($nick)] && ([clock seconds] - $::checks($nick)) < $::youtube(spam)} { putserv "PRIVMSG $chan :Fk off spammer.."; return }
set ::checks($nick) [clock seconds]
if {$arg == ""} { putmsg $nick "Please use: $::youtube(trigger) KEYWORD"; return }
set form [http::formatQuery search_query $arg search search]
set tok [http::geturl http://www.youtube.com/results?search_query=$form -timeout $::youtube(timeout)]
set data [http::data $tok]
http::cleanup $tok
set a "0"
while {[regexp -- {<a id="video-long-title-.*?" href="(.*?)" title="(.*?)" rel="nofollow">(.*)$} $data -> number title data]} {
if {$a == $::youtube(results)} { break }
putserv "PRIVMSG $chan :\[\002\0037Título\003\002: $title \002\0037Link:\003\002 http://youtube.com$number \ ]"
incr a
}
if {![info exists title]} { putserv "PRIVMSG $chan :\002Error:\002 Nothing was found for '$arg', you kill me!" }
}
tigrato
Voice
Posts: 22 Joined: Sat Jul 04, 2009 7:46 am
Post
by tigrato » Wed Sep 29, 2010 3:35 pm
someone can help? I need an youtube search script
demetrius_reis
Halfop
Posts: 42 Joined: Tue Aug 10, 2010 9:54 am
Post
by demetrius_reis » Wed Sep 29, 2010 7:51 pm
Code: Select all
package require http
set youtube(timeout) "600000" ;# Youtube geturl timeout. (better leave this default)
set youtube(results) "5" ;# Results to display
set youtube(trigger) "!youtube" ;# Search trigger
set youtube(spam) "5" ;# Spam protection in seconds
bind pub - $::youtube(trigger) youtube
proc youtube {nick uhost hand chan arg} {
if {[info exists ::checks($nick)] && ([clock seconds] - $::checks($nick)) < $::youtube(spam)} { sendmsg $chan "Fk off spammer.."; return }
set ::checks($nick) [clock seconds]
if {$arg == ""} { putmsg $nick "Please use: $::youtube(trigger) KEYWORD"; return }
set form [http::formatQuery search_query $arg search search]
set tok [http::geturl http://www.youtube.com/results?search_type=&$form -timeout $::youtube(timeout)]
set data [http::data $tok]
http::cleanup $tok
set a "0"
while {[regexp -- {<a id="video-short-title.*?" href="(.*?)" title="(.*?)" rel="nofollow">(.*)$} $data -> number title data]} {
if {$a == $::youtube(results)} { break }
sendmsg $chan "\[Title: $title Link:http://youtube.com$number\]"
incr a
}
if {![info exists title]} { sendmsg $chan "\002Error:\002 Nothing found for '$arg'" }
}
proc "sendmsg" { target message } {
sputraw "PRIVMSG [string tolower $target] :$message"
}
proc "sputraw" { text } {
set text [string trim $text]
putdccraw 0 [string length $text\n] $text\n
}
tigrato
Voice
Posts: 22 Joined: Sat Jul 04, 2009 7:46 am
Post
by tigrato » Thu Sep 30, 2010 9:08 am
This script don't work...
username
Op
Posts: 196 Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:
Post
by username » Thu Sep 30, 2010 2:37 pm
If you use Eggdrop 1.6.20 change
Code: Select all
putdccraw 0 [string length $text\n] $text\n
to
tigrato
Voice
Posts: 22 Joined: Sat Jul 04, 2009 7:46 am
Post
by tigrato » Fri Oct 01, 2010 10:19 am
username wrote: If you use Eggdrop 1.6.20 change
Code: Select all
putdccraw 0 [string length $text\n] $text\n
to
Thanks username but still don't work. Bot give me this message
Error: Nothing found for 'tigrato'
If you could help me....
username
Op
Posts: 196 Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:
Post
by username » Fri Oct 01, 2010 1:07 pm
tigrato
Voice
Posts: 22 Joined: Sat Jul 04, 2009 7:46 am
Post
by tigrato » Fri Oct 01, 2010 1:24 pm
username wrote: It works fine.
My server are located in France (OVH) and youtube give a page to choose the language and country and don't present the correct page of search. I need a sollution...
username
Op
Posts: 196 Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:
Post
by username » Fri Oct 01, 2010 2:50 pm
Try change
Code: Select all
http://www.youtube.com/results?search_query=$form
to
Code: Select all
http://www.youtube.com/results?search_query=$form&gl=US
tigrato
Voice
Posts: 22 Joined: Sat Jul 04, 2009 7:46 am
Post
by tigrato » Fri Oct 01, 2010 4:05 pm
Still don't work.
Thanks username
tigrato
Voice
Posts: 22 Joined: Sat Jul 04, 2009 7:46 am
Post
by tigrato » Sat Oct 02, 2010 5:34 am
demetrius_reis wrote: version 1.6.20
I don't understand...