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.

adding throttle in m00nie's youtube tcl

Support & discussion of released scripts, and announcements of new releases.
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

The best!

Post by m4s »

Hi, m00nie!

Thanks a lot, it works fine!
It's a great script!

(I added the ytsearch flag to switch on/off the searching function only: .chanset #channel +ytsearch)

Cheers
Last edited by m4s on Sun Apr 05, 2020 12:08 pm, edited 1 time in total.
A
AlbozZz
Voice
Posts: 3
Joined: Sun Jan 26, 2020 5:59 pm

Some errors to be fix here

Post by AlbozZz »

http://paste.tclhelp.net/?id=6ia7

Some error to be fix if u can thx in advance m00nie

Code: Select all


Line 33: WARNING: Unknown command "tls::init"
Line 34: WARNING: Unknown command "tls::socket"
Line 46: ERROR: Unknown variable "m00nie::youtube::regex"
Line 50: ERROR: Unknown variable "m00nie::youtube::key"
Line 84: ERROR: Unknown variable "m00nie::youtube::user_throt"
Line 85: ERROR: Unknown variable "m00nie::youtube::chan_throt"
Line 93: NOTICE: Found constant "rawpage" which is also a variable.
Line 97: WARNING: Unknown command "json::json2dict"
Line 108: ERROR: Unknown variable "m00nie::youtube::key"

m
m00nie
Voice
Posts: 14
Joined: Sat Mar 28, 2020 2:02 pm

Re: The best!

Post by m00nie »

m4s wrote: (I added the ytsearch flag to switch on/off the searching functions only: .chanset #channel +ytsearch)
Hi m4s 😁

Thanks for the good idea. I've added that to the script and posted an update, cheers for the suggestion.

@AlbozZz sorry I'm not familiar with that help site but it looks like it's missed the TCL packages like TLS etc? If you run the script on your bit and it fails please post the output from that and people should be able to help

Cheers

m00nie
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Re: The best!

Post by m4s »

m00nie wrote:Hi m4s 😁

Thanks for the good idea. I've added that to the script and posted an update, cheers for the suggestion.
Hi again,

Do you have time to have a look at your news eggdrop script? :)
I have problems with it...:\
m
m00nie
Voice
Posts: 14
Joined: Sat Mar 28, 2020 2:02 pm

Post by m00nie »

Sure (not wanting to take this off topic and upset the mods but) I'll have a look over the next short while and see if I can sort it too 😁
Cheers

m00nie
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Off topic

Post by m4s »

m00nie wrote:Sure (not wanting to take this off topic.... 😁
m00nie
Let's continue here: http://forum.egghelp.org/viewtopic.php?t=20735
Thanks! :)
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Post by m4s »

The latest YouTube script can be downloaded from here:

https://www.m00nie.com/youtube-eggdrop- ... ng-api-v3/
Last edited by m4s on Wed Apr 08, 2020 1:26 am, edited 1 time in total.
m
m00nie
Voice
Posts: 14
Joined: Sat Mar 28, 2020 2:02 pm

Post by m00nie »

v2.1 adds per search/link throttling, a parsing fix and more 'modern' way of doing TLS (before that breaks) ☺️
Cheers

m00nie
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Link throttling

Post by m4s »

Hi m00nie!

What is link throttling?

Thanks!

p.s.: script version is 2.2. :)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Throttling is limiting the usage if the number of requests are above a certain amount in a small window time frame, basically prevent others from flooding your bot with commands to fetch results.

Why don't you store variables inside an array, I mean instead of:

Code: Select all

    variable user_throt 30
    variable chan_throt 10
    variable link_throt 300
have:

Code: Select all

    set yt(user_throt) 30
    set yt(chan_throt) 10
    set yt(link_throt) 300
and first line under the proc line, let's say this one:

Code: Select all

proc autoinfo {nick uhost hand chan text} {
just add a:

Code: Select all

variable yt
for example and where needed just use $yt(user_throt) for example instead of that $m00nie::youtube::regex for example.
Once the game is over, the king and the pawn go back in the same box.
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Post by m4s »

caesar wrote:Throttling is limiting the usage if the number of requests are above a certain amount in a small window time frame, basically prevent others from flooding your bot with commands to fetch results.
But where are the number of requests defined?
The variable user_throt 30 means the user has 30 seconds to send yt links to the channel. Right? But how many requests means the flood?

Thanks! :)
m
m00nie
Voice
Posts: 14
Joined: Sat Mar 28, 2020 2:02 pm

Post by m00nie »

Hi Caesar

Thanks for the suggestion I'll have a look into it and see if that would help (just a different way than I've done it before so something to learn/try for me) 😁

m4s the default is one request per user ever 30s, one per channel every 10s and the same search term or link spammed in 5 mins and it jumped to 2.2 very quickly when the logic for checking was a bit....crap in the real world but hopefully better now
Cheers

m00nie
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Post by m4s »

m00nie wrote: m4s the default is one request per user ever 30s, one per channel every 10s and the same search term or link spammed in 5 mins a....
Cheers
m00nie
Now I got it!
Thanks m00nie & Cheers :)
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Thanks m00nie helped a lot cheers
ComputerTech
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

there seems to be something broken in the script recently

been gettin this error in PL:
<TCL-IRC> Tcl error [m00nie::youtube::autoinfo]: unable to convert date-time string "2019-08-17T17:43:19Z": more than one time zone in string
Last edited by simo on Sun May 17, 2020 9:35 am, edited 2 times in total.
Post Reply