egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

adding throttle in m00nie's youtube tcl
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Sun Mar 29, 2020 1:36 pm    Post subject: The best! Reply with quote

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
Back to top
View user's profile Send private message
AlbozZz
Voice


Joined: 26 Jan 2020
Posts: 3

PostPosted: Sun Mar 29, 2020 3:30 pm    Post subject: Some errors to be fix here Reply with quote

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

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

Code:


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"

Back to top
View user's profile Send private message
m00nie
Voice


Joined: 28 Mar 2020
Posts: 14

PostPosted: Sun Mar 29, 2020 4:21 pm    Post subject: Re: The best! Reply with quote

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
Back to top
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Mon Mar 30, 2020 2:45 pm    Post subject: Re: The best! Reply with quote

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? Smile
I have problems with it...:\
Back to top
View user's profile Send private message
m00nie
Voice


Joined: 28 Mar 2020
Posts: 14

PostPosted: Tue Mar 31, 2020 3:50 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Wed Apr 01, 2020 12:31 pm    Post subject: Off topic Reply with quote

m00nie wrote:
Sure (not wanting to take this off topic.... 😁
m00nie

Let's continue here: http://forum.egghelp.org/viewtopic.php?t=20735
Thanks! Smile
Back to top
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Sun Apr 05, 2020 12:06 pm    Post subject: Reply with quote

The latest YouTube script can be downloaded from here:

https://www.m00nie.com/youtube-eggdrop-script-using-api-v3/


Last edited by m4s on Wed Apr 08, 2020 1:26 am; edited 1 time in total
Back to top
View user's profile Send private message
m00nie
Voice


Joined: 28 Mar 2020
Posts: 14

PostPosted: Tue Apr 07, 2020 4:33 pm    Post subject: Reply with quote

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

m00nie
Back to top
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Wed Apr 08, 2020 12:53 am    Post subject: Link throttling Reply with quote

Hi m00nie!

What is link throttling?

Thanks!

p.s.: script version is 2.2. Smile
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Apr 08, 2020 7:18 am    Post subject: Reply with quote

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:

    variable user_throt 30
    variable chan_throt 10
    variable link_throt 300

have:
Code:

    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:

proc autoinfo {nick uhost hand chan text} {

just add a:
Code:

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.
Back to top
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Wed Apr 08, 2020 8:21 am    Post subject: Reply with quote

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! Smile
Back to top
View user's profile Send private message
m00nie
Voice


Joined: 28 Mar 2020
Posts: 14

PostPosted: Wed Apr 08, 2020 10:53 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 97

PostPosted: Wed Apr 08, 2020 12:58 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Sat Apr 18, 2020 8:31 am    Post subject: Reply with quote

Thanks m00nie helped a lot cheers
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat May 16, 2020 12:12 pm    Post subject: Reply with quote

there seems to be something broken in the script recently

been gettin this error in PL:

Quote:

<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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber