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
 
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: 77

PostPosted: Sun May 17, 2020 5:23 am    Post subject: Reply with quote

Yes, I also got an error message. Sad

[11:20] Tcl error [m00nie::youtube::autoinfo]: unable to convert date-time string "2020-05-16T11:51:42Z": more than one time zone in string
Back to top
View user's profile Send private message
ComputerTech
Op


Joined: 22 Feb 2020
Posts: 106
Location: Ireland

PostPosted: Sun May 17, 2020 8:21 am    Post subject: Reply with quote

i havent checked the script but on guess of what i know there must be a area to set the timezone and most lightly like this

Code:

set timezone "timezone"
 



and check if both " " are there and not just one Very Happy
i'll look at the script in a bit Wink
_________________
Think Positive
Back to top
View user's profile Send private message Send e-mail Visit poster's website
caesar
Mint Rubber


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

PostPosted: Sun May 17, 2020 10:30 am    Post subject: Reply with quote

Not sure what this 2 lines
Code:

regsub {\.000Z} $pubiso "" pubiso
regsub -all {Z} $pubiso "" pubiso

are supposed to do since don't have the code running and can only guess..

Anyway, replacing the:
Code:

set pubtime [clock format [clock scan $pubiso]]

with:
Code:

set pubtime [clock format [clock scan [string map [list "T" " " "Z" ""] $pubiso]]]

should do the trick.
_________________
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
simo
Master


Joined: 22 Mar 2015
Posts: 372

PostPosted: Sun May 17, 2020 11:14 am    Post subject: Reply with quote

excellent that seems to do it caesar tnx for the swift reply and fix
_________________
Coming together is a beginning, staying together is progress, working together is succes.
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 372

PostPosted: Sun May 17, 2020 11:40 am    Post subject: Reply with quote

in all fairness i must comment that m00nie seems to already have fixed that bug in his latest release as i didnt check his latest release i just did
just wanted to say this but none the less thx caesar for providing a quick fix
_________________
Coming together is a beginning, staying together is progress, working together is succes.
Back to top
View user's profile Send private message
m4s
Halfop


Joined: 30 Jan 2017
Posts: 77

PostPosted: Sun May 17, 2020 12:45 pm    Post subject: Reply with quote

Oh, I did not check either. Rolling Eyes
Thanks to everyone!
Back to top
View user's profile Send private message
caesar
Mint Rubber


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

PostPosted: Mon May 18, 2020 1:28 am    Post subject: Reply with quote

I looked on the website at comments section and saw an output from YouTube's API:
Code:

[14:53:42] m00nie::youtube::getinfo IDS are {snippet {publishedAt 2015-08-10T22:24:25.000Z title {IFC's VICE Parody: 'DRONEZ' (Full Episode)} channelTitle VICE} contentDetails {duration PT22M52S} statistics {viewCount 36205}}

and notice the 'publishedAt' is 2015-08-10T22:24:25.000Z

Those two lines I was puzzled about:
Code:

regsub {\.000Z} $pubiso "" pubiso
regsub -all {Z} $pubiso "" pubiso

do this:
Code:

% set pubiso "2015-08-10T22:24:25.000Z"
2015-08-10T22:24:25.000Z
% regsub {\.000Z} $pubiso "" pubiso
1
% regsub -all {Z} $pubiso "" pubiso
0
% puts $pubiso
2015-08-10T22:24:25
% clock format [clock scan $pubiso]
Tue Aug 11 08:24:25 EEST 2015

From here I notice two things:

1. The presence of the T in the $pubiso
2. The 'clock format' output is WRONG because the '2015-08-10 22:24:25' (notice that i just removed the T) becomes 'Tue Aug 11 08:24:25 EEST 2015' after 'clock format'

I would just ditch those 'regsub' lines and just use 'string map' instead:
Code:

set pubiso [string map {"T" " " ".000Z" ""} $pubiso]

while keeping the original:
Code:

set pubtime [clock format [clock scan $pubiso]]

and thus ignoring my previous fix. The output is clean as it should be:
Code:

% set pubiso "2015-08-10T22:24:25.000Z"
2015-08-10T22:24:25.000Z
% set pubiso [string map {"T" " " ".000Z" ""} $pubiso]
2015-08-10 22:24:25

so this means that after 'clock format' the formatted date is correct:
Code:

% clock format [clock scan $pubiso]
Mon Aug 10 22:24:25 EEST 2015

_________________
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
m00nie
Voice


Joined: 28 Mar 2020
Posts: 10

PostPosted: Tue May 19, 2020 3:41 am    Post subject: Reply with quote

Hi Caesar ☺️

Thanks for the spot on the date being red incorrectly.ive updated the script to sort this along with your suggestion of the string maps (which I've never used before now so nice to learn something cleaner 😁)
The change that broke the script though is the API now randomly(?) seems to append a single Z rather than the expected .000Z we got before (something to do with recommend way to pass time in C+)
v2.4 should hopefully fix both probs
Cheers

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


Joined: 22 Mar 2015
Posts: 372

PostPosted: Tue May 19, 2020 9:43 am    Post subject: Reply with quote

hey there m00nie i loaded your youtube tcl 2.4 in tcl pastebin and it returned a few errors

Quote:

Line 36: ERROR: Unknown variable "m00nie::youtube::regex"
Line 40: ERROR: Unknown variable "m00nie::youtube::key"
Line 79: ERROR: Unknown variable "m00nie::youtube::user_throt"
Line 80: ERROR: Unknown variable "m00nie::youtube::chan_throt"
Line 81: ERROR: Unknown variable "m00nie::youtube::link_throt"
Line 89: NOTICE: Found constant "rawpage" which is also a variable.
Line 93: WARNING: Unknown command "json::json2dict"
Line 105: ERROR: Unknown variable "m00nie::youtube::key"


_________________
Coming together is a beginning, staying together is progress, working together is succes.
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
Page 3 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