It is currently October 18th, 2024, 11:24 am

Problem with YouTube Subs Counter

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 8485
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Problem with YouTube Subs Counter

Post by Yincognito »

Rooky_89 wrote: October 5th, 2024, 5:04 pm Hello, Nice Topic is, fits well with a topic of mine 8-) :great: . So i will not start a new Topic. So i ask here, is it possible to grab up an information if comes a new Video online from an Youtuber? :oops:


youtube_counter.png
If you mean based on your subscriptions, I personally didn't subscribe to any youtuber to be able to test how the corresponding webpage source of YouTube looks like, if the desired data is displayed on the page, if it can be retrieved from it, or on which regex pattern it is based. You'd need to provide some example, e.g. a screenshot, the contents of the webpage source (right click and View Page Source, in Chrome), etc. in order to have an accurate assessment of that...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 377
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Problem with YouTube Subs Counter

Post by RicardoTM »

There's no part on youtube (that I know of) that says if a channel has uploaded a new video. Although what I think could work, is to parse the videos section of a channel, and extract the title of the latest video, then use a measure to compare it to the latest title each time it parsed it, and do something if that titile changed. Could work :???:

I haven't inspected the site since i'm on my phone, but this is the page I'm talking about: https://m.youtube.com/@MrBeast/videos

It even displays the latest video's "date".

Edit.

Looks like "publishedTimeText":{"simpleText":"hace 7 días"} could help (mine is in Spanish tho, but it says "7 days ago.").
User avatar
Rooky_89
Posts: 70
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Problem with YouTube Subs Counter

Post by Rooky_89 »

Hello, :welcome: :lol:
i have an issue with the Grid of the icons. Tried to show a single icon of the Icon Grid, but it does not showing up. Tryed with [!ShowMeter YT1_ICO][!Redraw] or [!ShowMeter MeterShapes]. Nope, it will not work too. :oops: The question is now how can i display one icon from the Icon grid

Code: Select all

;==========================================================
; #GRID-ICONS	#GRID-ICONS	#GRID-ICONS	#GRID-ICONS
;==========================================================
;
[MeterShapes]
Meter=Shape
Shape=Rectangle #posx1#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape2=Rectangle #posx2#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape3=Rectangle #posx3#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape4=Rectangle #posx4#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape5=Rectangle #posx5#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Hidden=1

[IconGroup_YT]
Container=MeterShapes
Group=Large
H=#IconSize#
W=#IconSize#
DynamicVariables=1

[YT1_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx1#
Y=#PosY#
ImageName=#YT1_ICO#
LeftMouseUpAction=!Execute [#YT1_URL#][!SetVariable YT1_Video [Calc_YT1]][!WriteKeyValue Variables YT1_Video [Calc_YT1]][!HideMeter Message_YT1][!Redraw]


[YT2_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx2#
Y=#PosY#
ImageName=#YT2_ICO#
LeftMouseUpAction=!Execute [#YT2_URL#][!SetVariable YT2_Video [Calc_YT2]][!WriteKeyValue Variables YT2_Video [Calc_YT2]][!HideMeter Message_YT2][!Redraw]


[YT3_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx3#
Y=#PosY#
ImageName=#YT3_ICO#
LeftMouseUpAction=!Execute [#YT3_URL#][!SetVariable YT3_Video [Calc_YT3]][!WriteKeyValue Variables YT3_Video [Calc_YT3]][!HideMeter Message_YT3][!Redraw]


[YT4_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx4#
Y=#PosY#
ImageName=#YT4_ICO#
LeftMouseUpAction=!Execute [#YT4_URL#][!SetVariable YT4_Video [Calc_YT4]][!WriteKeyValue Variables YT4_Video [Calc_YT4]][!HideMeter Message_YT4][!Redraw]


[YT5_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx5#
Y=#PosY#
ImageName=#YT5_ICO#
LeftMouseUpAction=!Execute [#YT5_URL#][!SetVariable YT5_Video [Calc_YT5]][!WriteKeyValue Variables YT5_Video [Calc_YT5]][!HideMeter Message_YT5][!Redraw]

Last edited by Rooky_89 on October 7th, 2024, 5:06 pm, edited 2 times in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 8485
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Problem with YouTube Subs Counter

Post by Yincognito »

Rooky_89 wrote: October 6th, 2024, 1:19 pm Hello, :welcome: :lol:
i have an issue with the Grid of the icons. Tried to show a single icon of the Icon Grid, but it does not showing up. Tryed with [!ShowMeter YT1_ICO][!Redraw] or [!ShowMeter MeterShapes]. Nope, it will not work too. :oops:
I have no idea about your actual scenario, but on your posted code (to which I added some of my own variable values and some solid color / background mode in [Rainmeter] to be able to test it - feel free to use your own), if you hide the container via Hidden=1, no meter will be visible, since they're all masked to its non transparent (but hidden, as per your setting) pixels:
https://docs.rainmeter.net/manual/meters/general-options/container/

Instead, you should let the container visible and use Hidden=1 in the IconGroup_YT style used for those image meters, if by any chance you want them to initially be invisible. Then, your [!ShowMeter YT1_ICO][!Redraw] bangs will work (I added them to the [Rainmeter]'s OnRefreshAction simply because I had no visible meter to add them to, in this scenario):

Code: Select all

[Variables]
YT1_ICO=#@#1.png
YT2_ICO=#@#2.png
YT3_ICO=#@#3.png
YT4_ICO=#@#4.png
YT5_ICO=#@#5.png
IconSize=50
PosY=0
posx1=0
posx2=100
posx3=200
posx4=300
posx5=400

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,1
OnRefreshAction=[!ShowMeter YT1_ICO][!Redraw]

;==========================================================
; #GRID-ICONS	#GRID-ICONS	#GRID-ICONS	#GRID-ICONS
;==========================================================
;
[MeterShapes]
Meter=Shape
Shape=Rectangle #posx1#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape2=Rectangle #posx2#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape3=Rectangle #posx3#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape4=Rectangle #posx4#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape5=Rectangle #posx5#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Hidden=0

[IconGroup_YT]
Container=MeterShapes
Group=Large
Hidden=1
H=#IconSize#
W=#IconSize#
DynamicVariables=1

[YT1_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx1#
Y=#PosY#
ImageName=#YT1_ICO#
LeftMouseUpAction=!Execute [#YT1_URL#][!SetVariable YT1_Video [Calc_YT1]][!WriteKeyValue Variables YT1_Video [Calc_YT1]][!HideMeter Message_YT1][!Redraw]


[YT2_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx2#
Y=#PosY#
ImageName=#YT2_ICO#
LeftMouseUpAction=!Execute [#YT2_URL#][!SetVariable YT2_Video [Calc_YT2]][!WriteKeyValue Variables YT2_Video [Calc_YT2]][!HideMeter Message_YT2][!Redraw]


[YT3_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx3#
Y=#PosY#
ImageName=#YT3_ICO#
LeftMouseUpAction=!Execute [#YT3_URL#][!SetVariable YT3_Video [Calc_YT3]][!WriteKeyValue Variables YT3_Video [Calc_YT3]][!HideMeter Message_YT3][!Redraw]


[YT4_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx4#
Y=#PosY#
ImageName=#YT4_ICO#
LeftMouseUpAction=!Execute [#YT4_URL#][!SetVariable YT4_Video [Calc_YT4]][!WriteKeyValue Variables YT4_Video [Calc_YT4]][!HideMeter Message_YT4][!Redraw]


[YT5_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx5#
Y=#PosY#
ImageName=#YT5_ICO#
LeftMouseUpAction=!Execute [#YT5_URL#][!SetVariable YT5_Video [Calc_YT5]][!WriteKeyValue Variables YT5_Video [Calc_YT5]][!HideMeter Message_YT5][!Redraw]
If you actually want those image meters to initially be shown, use Hidden=0 in the IconGroup_YT style, then, since they are all shown, you'll need to hide their group before showing the one you're interested in, e.g. [!HideMeterGroup Large][!ShowMeter YT1_ICO][!Redraw]. Either that or hide every such meter except the desired one, e.g. [!HideMeter YT2_ICO][!HideMeter YT3_ICO][!HideMeter YT4_ICO][!HideMeter YT5_ICO][!Redraw].

P.S. Also, you could rename IconGroup_YT to IconStyle_YT, to avoid confusion, since it's technically a meter style section and not a group option (the group is called Large here, but it can obviously be renamed too, for better clarity).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Rooky_89
Posts: 70
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Problem with YouTube Subs Counter

Post by Rooky_89 »

Yincognito wrote: October 6th, 2024, 5:52 pm
I have no idea about your actual scenario ( :lol: if so, then you are the next Houdini :lol: )
Thank you for your Time, description and Work. It helps me a lot. I Inserted in the [MeterShapes] the Hidden=1... :???: and tried to get the Ico with [!ShowMeter YT1_ICO] to show.. That was the reason... That was the mistake. :great: :lol:

One Problem solved, another comes... String "Youtube" does not disappear :rofl: :oops:
Last edited by Rooky_89 on October 7th, 2024, 4:50 pm, edited 2 times in total.
RicardoTM
Posts: 377
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Problem with YouTube Subs Counter

Post by RicardoTM »

Rooky_89 wrote: October 6th, 2024, 6:58 pm Thank you for your Time, description and Work. It helps me a lot. I Inserted in the [MeterShapes] the Hidden=1... :???: and tried to get the Ico with [!ShowMeter YT1_ICO] to show.. That was the reason... That was the mistake. :great: :lol:

Just wondering, did you use what I suggested here?
RicardoTM wrote: October 5th, 2024, 11:15 pm Looks like "publishedTimeText":{"simpleText":"hace 7 días"} could help (mine is in Spanish tho, but it says "7 days ago.").
Did it work?
User avatar
Rooky_89
Posts: 70
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Problem with YouTube Subs Counter

Post by Rooky_89 »

RicardoTM wrote: October 6th, 2024, 7:44 pm
Did it work?
Hi, i used your code it is exactly that what i needed. I changed the source code a little. For me does it work. You can download my project above. :oops: :bow:
User avatar
Yincognito
Rainmeter Sage
Posts: 8485
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Problem with YouTube Subs Counter

Post by Yincognito »

Rooky_89 wrote: October 6th, 2024, 6:58 pmOne Problem solved, another comes... String "Youtube" does not disappear :rofl: :oops:
This is based on your earlier post, might be what you wanted (though the approach could be even better):

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1


[Variables]
background=#@#background2.png
background_W=300
background_H=70
transparenz=150
;--------------------------------------
IconSize=45
;--------------------------------------
posx1=65
PosY=15
YT1_ICO=@Icons\alexibexi.jpg
YT1_URL=https://www.youtube.com/user/alexibexi
YT1_Video=888		
;--------------------------------------
posx2=112
YT2_ICO=@Icons\aramismerlin.jpg
YT2_URL=https://www.youtube.com/@AramisMerlin
YT2_Video=490		
;--------------------------------------
posx3=159
YT3_ICO=@Icons\nukestop5.jpg
YT3_URL=https://www.youtube.com/@NukesTop5
YT3_Video=292		
;--------------------------------------
posx4=206
YT4_ICO=@Icons\insolito.jpg
YT4_URL=https://www.youtube.com/@Insolito
YT4_Video=357		
;--------------------------------------
posx5=253
YT5_ICO=@Icons\sirspooks.jpg
YT5_URL=https://www.youtube.com/@Sirspooks
YT5_Video=353		
;--------------------------------------
;
;==================================================================
; #BASE		#BASE		#BASE		#BASE
;==================================================================
;
[CoverContainer]
Meter=Shape
Shape=Rectangle 2,2,#background_W#,#background_H#,8 | StrokeWidth 0

[LineBorder]
Meter=Shape
Shape=Rectangle 2,2,300,70,10 | Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,0,0,140

[Background]
Meter=Image
ImageName=#background#
Container=CoverContainer
AntiAlias=1
ImageAlpha=#transparenz#
MouseOverAction=[!HideMeter Headline][!SetOption YT1_ICO Hidden ([Calc_YT1]>#YT1_Video#?0:1)][!SetOption YT2_ICO Hidden ([Calc_YT2]>#YT2_Video#?0:1)][!SetOption YT3_ICO Hidden ([Calc_YT3]>#YT3_Video#?0:1)][!SetOption YT4_ICO Hidden ([Calc_YT4]>#YT4_Video#?0:1)][!SetOption YT5_ICO Hidden ([Calc_YT5]>#YT5_Video#?0:1)][!UpdateMeterGroup Large][!Redraw]
MouseLeaveAction=[!ShowMeter Headline][!HideMeterGroup Large][!Redraw]
DynamicVariables=1


[YoutubeICON]
Meter=Image
ImageName=\@Icons\youtube.png
X=8
Y=(#background_H#-40)/2
W=46
H=46
AntiAlias=1

[Headline]
Meter=String
FontFace=Arial
FontStyle=BOLD
FontSize=25
FontColor=255,255,255,255
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
X=100
Y=(#background_H#-37)/2
Text="Youtube"
AntiAlias=1

;==========================================================
; #GRID-ICONS	#GRID-ICONS	#GRID-ICONS	#GRID-ICONS
;==========================================================
;
[MeterShapes]
Meter=Shape
Shape=Rectangle #posx1#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape2=Rectangle #posx2#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape3=Rectangle #posx3#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape4=Rectangle #posx4#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape5=Rectangle #posx5#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Hidden=0

[IconGroup_YT]
Container=MeterShapes
Group=Large
H=#IconSize#
W=#IconSize#
Hidden=1
DynamicVariables=1

[YT1_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx1#
Y=#PosY#
ImageName=#YT1_ICO#
LeftMouseUpAction=!Execute [#YT1_URL#][!SetVariable YT1_Video [Calc_YT1]][!WriteKeyValue Variables YT1_Video [Calc_YT1]][!HideMeter Message_YT1][!Redraw]


[YT2_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx2#
Y=#PosY#
ImageName=#YT2_ICO#
LeftMouseUpAction=!Execute [#YT2_URL#][!SetVariable YT2_Video [Calc_YT2]][!WriteKeyValue Variables YT2_Video [Calc_YT2]][!HideMeter Message_YT2][!Redraw]


[YT3_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx3#
Y=#PosY#
ImageName=#YT3_ICO#
LeftMouseUpAction=!Execute [#YT3_URL#][!SetVariable YT3_Video [Calc_YT3]][!WriteKeyValue Variables YT3_Video [Calc_YT3]][!HideMeter Message_YT3][!Redraw]


[YT4_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx4#
Y=#PosY#
ImageName=#YT4_ICO#
LeftMouseUpAction=!Execute [#YT4_URL#][!SetVariable YT4_Video [Calc_YT4]][!WriteKeyValue Variables YT4_Video [Calc_YT4]][!HideMeter Message_YT4][!Redraw]


[YT5_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx5#
Y=#PosY#
ImageName=#YT5_ICO#
LeftMouseUpAction=!Execute [#YT5_URL#][!SetVariable YT5_Video [Calc_YT5]][!WriteKeyValue Variables YT5_Video [Calc_YT5]][!HideMeter Message_YT5][!Redraw]

;
;==========================================================
; #WEB-PARSER	#WEB-PARSER	#WEB-PARSER	#WEB-PARSER
;==========================================================
;
[Youtuber_1]
Measure=WebParser
URL=#YT1_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT1][!UpdateMeasure Calc_YT1]
;
;---
;
[Youtuber_2]
Measure=WebParser
URL=#YT2_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT2][!UpdateMeasure Calc_YT2]
;
;---
;
[Youtuber_3]
Measure=WebParser
URL=#YT3_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT3][!UpdateMeasure Calc_YT3]
;
;---
;
[Youtuber_4]
Measure=WebParser
URL=#YT4_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT4][!UpdateMeasure Calc_YT4]
;
;---
;
[Youtuber_5]
Measure=WebParser
URL=#YT5_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT5][!UpdateMeasure Calc_YT5]
;
;==========================================================
; #CALC-MEASURE	#CALC-MEASURE	#CALC-MEASURE	
;==========================================================
;
[Calc_YT1]
Disabled=1
Measure=Calc
Formula=[&Youtuber_1]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT1_Video#)
IfTrueAction=[!ShowMeter Message_YT1][!UpdateMeter Subscribers1][!Redraw]
DynamicVariables=1
;
;---
;
[Calc_YT2]
Disabled=1
Measure=Calc
Formula=[&Youtuber_2]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT2_Video#)
IfTrueAction=[!ShowMeter Message_YT2][!UpdateMeter Subscribers2][!Redraw]
DynamicVariables=1
;
;---
;
[Calc_YT3]
Disabled=1
Measure=Calc
Formula=[&Youtuber_3]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT3_Video#)
IfTrueAction=[!ShowMeter Message_YT3][!UpdateMeter Subscribers3][!Redraw]
DynamicVariables=1
;
;---
;
[Calc_YT4]
Disabled=1
Measure=Calc
Formula=[&Youtuber_4]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT4_Video#)
IfTrueAction=[!ShowMeter Message_YT4][!UpdateMeter Subscribers4][!Redraw]
DynamicVariables=1
;
;---
;
[Calc_YT5]
Disabled=1
Measure=Calc
Formula=[&Youtuber_5]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT5_Video#)
IfTrueAction=[!ShowMeter Message_YT5][!UpdateMeter Subscribers5][!Redraw]
DynamicVariables=1
;
;==============================================================
; #STRING-MESSAGE	#STRING-MESSAGE		#STRING-MESSAGE	
;==============================================================
[Subscribers1]
Meter=String
MeasureName=Youtuber_1
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT1]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx1#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1
;----------------------------
[Subscribers2]
Meter=String
MeasureName=Youtuber_2
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT2]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx2#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1
;----------------------------
[Subscribers3]
Meter=String
MeasureName=Youtuber_3
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT3]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx3#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1
;----------------------------
[Subscribers4]
Meter=String
MeasureName=Youtuber_4
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT4]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx4#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1
;----------------------------
[Subscribers5]
Meter=String
MeasureName=Youtuber_5
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT5]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx5#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Rooky_89
Posts: 70
Joined: September 21st, 2024, 4:57 pm
Location: Germany, in the stone cave

Re: Problem with YouTube Subs Counter

Post by Rooky_89 »

Yincognito wrote: October 6th, 2024, 8:04 pm
(though the approach could be even better) [!SetOption Message_YT4 Hidden ([Calc_YT4]>#YT4_Video#?0:0)]

I have a few small problems... The MouseOver Calc is not correct. It always shows +1, even if the number of videos has been updated. I tryed just for Youtuber 4



Skin-Youtube:
Youtube_.rmskin
New-Code:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1


[Variables]
background=#@#background2.png
background_W=300
background_H=70
transparenz=150
;--------------------------------------
IconSize=45
;--------------------------------------
posx1=65
PosY=15
YT1_ICO=@Icons\alexibexi.jpg
YT1_URL=https://www.youtube.com/user/alexibexi
YT1_Video=888		
;--------------------------------------
posx2=112
YT2_ICO=@Icons\aramismerlin.jpg
YT2_URL=https://www.youtube.com/@AramisMerlin
YT2_Video=490		
;--------------------------------------
posx3=159
YT3_ICO=@Icons\nukestop5.jpg
YT3_URL=https://www.youtube.com/@NukesTop5
YT3_Video=292		
;--------------------------------------
posx4=206
YT4_ICO=@Icons\insolito.jpg
YT4_URL=https://www.youtube.com/@Insolito
YT4_Video=357		
;--------------------------------------
posx5=253
YT5_ICO=@Icons\sirspooks.jpg
YT5_URL=https://www.youtube.com/@Sirspooks
YT5_Video=353		
;--------------------------------------
;
;==================================================================
; #BASE		#BASE		#BASE		#BASE
;==================================================================
;
[CoverContainer]
Meter=Shape
Shape=Rectangle 2,2,#background_W#,#background_H#,8 | StrokeWidth 0

[LineBorder]
Meter=Shape
Shape=Rectangle 2,2,300,70,10 | Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,0,0,140

[Background]
Meter=Image
ImageName=#background#
Container=CoverContainer
AntiAlias=1
ImageAlpha=#transparenz#
MouseOverAction=[!HideMeter Headline][!HideMeter Headline2][!ShowMeterGroup YOUTUBE][!SetOption Message_YT4 Hidden ([Calc_YT4]>#YT4_Video#?0:0)][!Update]				[!Redraw]
;--}
MouseLeaveAction=[!ShowMeter YoutubeICON][!ShowMeter Headline][!HideMeter Message_YT4][!HideMeterGroup YOUTUBE][!Redraw][!Update]


[YoutubeICON]
Meter=Image
ImageName=\@Icons\youtube.png
X=8
Y=(#background_H#-40)/2
W=46
H=46
AntiAlias=1

[Headline]
Meter=String
FontFace=Arial
FontStyle=BOLD
FontSize=25
FontColor=255,255,255,255
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
X=100
Y=(#background_H#-37)/2
Text="Youtube"
AntiAlias=1

[Headline2]
Meter=String
FontFace=Arial
FontStyle=BOLD
FontSize=11
FontColor=255,255,255,255
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
X=65
Y=50
Text="New Video"
AntiAlias=1
Hidden=1

;==========================================================
; #GRID-ICONS	#GRID-ICONS	#GRID-ICONS	#GRID-ICONS
;==========================================================
;
[MeterShapes]
Meter=Shape
Shape=Rectangle #posx1#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape2=Rectangle #posx2#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape3=Rectangle #posx3#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape4=Rectangle #posx4#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1
Shape5=Rectangle #posx5#,#PosY#,#IconSize#,#IconSize#,#IconSize# | Fill Color 255,255,255,255 | StrokeWidth 1 | Stroke Color 0,0,0,1

[IconGroup_YT]
Container=MeterShapes
Group=YOUTUBE
H=#IconSize#
W=#IconSize#
DynamicVariables=1
Hidden=1

[YT1_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx1#
Y=#PosY#
ImageName=#YT1_ICO#
LeftMouseUpAction=!Execute [#YT1_URL#][!SetVariable YT1_Video [Calc_YT1]][!WriteKeyValue Variables YT1_Video [Calc_YT1]][!HideMeter Message_YT1][!Redraw]
Hidden=1

[YT2_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx2#
Y=#PosY#
ImageName=#YT2_ICO#
LeftMouseUpAction=!Execute [#YT2_URL#][!SetVariable YT2_Video [Calc_YT2]][!WriteKeyValue Variables YT2_Video [Calc_YT2]][!HideMeter Message_YT2][!Redraw]
Hidden=1

[YT3_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx3#
Y=#PosY#
ImageName=#YT3_ICO#
LeftMouseUpAction=!Execute [#YT3_URL#][!SetVariable YT3_Video [Calc_YT3]][!WriteKeyValue Variables YT3_Video [Calc_YT3]][!HideMeter Message_YT3][!Redraw]
Hidden=1

[YT4_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx4#
Y=#PosY#
ImageName=#YT4_ICO#
LeftMouseUpAction=!Execute [#YT4_URL#][!SetVariable YT4_Video [Calc_YT4]][!WriteKeyValue Variables YT4_Video [Calc_YT4]][!UpdateMeasure Calc_YT4][!Redraw]
Hidden=1

[YT5_ICO]
Meter=Image
MeterStyle=IconGroup_YT
X=#posx5#
Y=#PosY#
ImageName=#YT5_ICO#
LeftMouseUpAction=!Execute [#YT5_URL#][!SetVariable YT5_Video [Calc_YT5]][!WriteKeyValue Variables YT5_Video [Calc_YT5]][!HideMeter Message_YT5][!Redraw]
Hidden=1
;
;==========================================================
; #WEB-PARSER	#WEB-PARSER	#WEB-PARSER	#WEB-PARSER
;==========================================================
;
[Youtuber_1]
Measure=WebParser
URL=#YT1_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT1][!UpdateMeasure Calc_YT1]
;
;---
;
[Youtuber_2]
Measure=WebParser
URL=#YT2_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT2][!UpdateMeasure Calc_YT2]
;
;---
;
[Youtuber_3]
Measure=WebParser
URL=#YT3_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT3][!UpdateMeasure Calc_YT3]
;
;---
;
[Youtuber_4]
Measure=WebParser
URL=#YT4_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT4][!UpdateMeasure Calc_YT4]
;
;---
;
[Youtuber_5]
Measure=WebParser
URL=#YT5_URL#
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Flags=ForceReload | NoCookies
RegExp=(?siU)(?|.*"contentMetadataViewModel":.*?"metadataParts".*"text":.*"content":.*"(\d+) .*"|.*?"subscriberCountText":.*"[^"]*text":"(\d+) .*")
StringIndex=1
UpdateRate=3600
FinishAction=[!EnableMeasure Calc_YT5][!UpdateMeasure Calc_YT5]
;
;==========================================================
; #CALC-MEASURE	#CALC-MEASURE	#CALC-MEASURE	
;==========================================================
;
[Calc_YT1]
Disabled=1
Measure=Calc
Formula=[&Youtuber_1]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT1_Video#)
IfTrueAction=[!ShowMeter Message_YT1][!UpdateMeter Subscribers1][!ShowMeter YT1_ICO][!Redraw]
DynamicVariables=1
;
;---
;
[Calc_YT2]
Disabled=1
Measure=Calc
Formula=[&Youtuber_2]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT2_Video#)
IfTrueAction=[!ShowMeter Message_YT2][!UpdateMeter Subscribers2][!Redraw]
DynamicVariables=1
;
;---
;
[Calc_YT3]
Disabled=1
Measure=Calc
Formula=[&Youtuber_3]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT3_Video#)
IfTrueAction=[!ShowMeter Message_YT3][!UpdateMeter Subscribers3][!Redraw]
DynamicVariables=1
;
;---
;
[Calc_YT4]
Disabled=1
Measure=Calc
Formula=[&Youtuber_4]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT4_Video#)
IfTrueAction=[!ShowMeter Headline2][!UpdateMeter Subscribers4][!Redraw]
DynamicVariables=1
;
;---
;
[Calc_YT5]
Disabled=1
Measure=Calc
Formula=[&Youtuber_5]
UpdateDivider=-1
IfCondition=(#CURRENTSECTION#>#YT5_Video#)
IfTrueAction=[!ShowMeter Message_YT5][!UpdateMeter Subscribers5][!Redraw]
DynamicVariables=1
;
;==============================================================
; #STRING-MESSAGE	#STRING-MESSAGE		#STRING-MESSAGE	
;==============================================================
[Subscribers1]
Meter=String
MeasureName=Youtuber_1
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT1]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx1#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1
;----------------------------
[Subscribers2]
Meter=String
MeasureName=Youtuber_2
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT2]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx2#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1
;----------------------------
[Subscribers3]
Meter=String
MeasureName=Youtuber_3
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT3]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx3#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1
;----------------------------
[Subscribers4]
Meter=String
MeasureName=Youtuber_4
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT4]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx4#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1
;----------------------------
[Subscribers5]
Meter=String
MeasureName=Youtuber_5
StringAlign=Left
Y=50
X=0
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Subs: %1
Hidden=1

[Message_YT5]
Meter=String
StringAlign=Left
Y=((#background_H#/2)+(#PosY#))
X=((#posx5#+12))
FontSize=12
FontWeight=700
FontColor=ff0000
SolidColor=255,255,255,20
InlineSetting=Shadow | 1 | 1 | 2 | 0,0,0,255
AntiAlias=1
Text=+1
Hidden=1

You do not have the required permissions to view the files attached to this post.
Last edited by Rooky_89 on October 9th, 2024, 5:16 pm, edited 1 time in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 8485
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Problem with YouTube Subs Counter

Post by Yincognito »

Rooky_89 wrote: October 7th, 2024, 4:52 pm I have some little Problems...
Unbenannt.png
Didn't check the code, but just from the top of my head, by looking at your post, [!SetOption Message_YT4 Hidden ([Calc_YT4]>#YT4_Video#?0:0)] will always keep the message shown, because it will set that Hidden option to 0 in either case:
https://docs.rainmeter.net/manual/formulas/#Conditional
What you'd need is something like [!SetOption Message_YT4 Hidden ([Calc_YT4]>#YT4_Video#?0:1)] or viceversa, depending on what you need.

Basically, in the part after the ? symbol, what's before : is the value if the conditional is true, and what's after : is the value if the conditional is false.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth