It is currently March 29th, 2024, 9:58 am

RegExp error (-8)

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RegExp error (-8)

Post by balala »

rbriddickk84 wrote:Okay, was there any change in the WebParser plugin lately? I was following every update, read all of them, but i don't recall that there was any modification to the webparser.
It don't work anymore as it worked when i was working with it, it was couple of updates before. Now it adresses totally different, or random things. I don't understand anymore what's happened. It should be working simple, but now it's whatever i try to do it's running in some errors, or grab some totally random code from random places.
I usually assume first that i am making the mistake, i am doing it wrong, i try so hard to figure it out where do i do wrong, but i am doing everything as i've done before many times. And it's not complicated code, it's a simple regexp code, and it don't work either.
I just don't get it. :???:
In the meantime, WebPasrer became a measure, but the old syntax, with Measure=Plugin and Plugin=WebPasrer still works, so practically there are no changes (or we can ignore them): https://forum.rainmeter.net/viewtopic.php?p=144148#p144148
In such cases try first to restart Rainmeter. This always should be done, if WebPasrer doesn't work properly: https://forum.rainmeter.net/viewtopic.php?p=136507#p136507
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: RegExp error (-8)

Post by rbriddickk84 »

I know obviously how to grab an image, you can see the outcommented sections in my code. ;)

The problem is with the Title part. There is a Title part on the website, here:
Rainmeter regexp.png
It's on the bottom.
You do not have the required permissions to view the files attached to this post.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: RegExp error (-8)

Post by rbriddickk84 »

balala wrote:In such cases try first to restart Rainmeter.
Yeah, it crashed a couple of times, so we can get it as "restarted" :lol:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RegExp error (-8)

Post by balala »

rbriddickk84 wrote:The problem is with the Title part. There is a Title part on the website, here:
Rainmeter regexp.png

It's on the bottom.
The problem is that although you see those elements this way, the order of them is exactly the opposite. In the code of the page you have first the <title> part, then that address.
Try the following RegExp: RegExp=(?siU)<title>(.*)</title>.*i.ytimg.com/vi/(.*)sqp
See the inverse order of the elements.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: RegExp error (-8)

Post by rbriddickk84 »

balala wrote:The problem is that although you see those elements this way, the order of them is exactly the opposite. In the code of the page you have first the <title> part, then that address.
Try the following RegExp: RegExp=(?siU)<title>(.*)</title>.*i.ytimg.com/vi/(.*)sqp
See the inverse order of the elements.
Okay, i gave it a last try of that, i just write this in the RegExp field:

RegExp=(?siU)<img src="(.*)sqp

Since it's only a few <img src is on the website's source, there shouldn't be a problem. But the webparser just took a totally different source from the site, like this:
Rainmeter regexp 2.png
This part is somewhere in the middle of the site's source code. I don't really get it! :???:
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: RegExp error (-8)

Post by balala »

I think this work perfectly for me:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
upath1=LAGxPeanutPwner

[SiteCheckA]
Measure=Plugin
Plugin=WebParser
Group=StatsA
URL=https://www.youtube.com/user/#upath1#/videos
RegExp=(?siU)<title>(.*)</title>.*i.ytimg.com/vi/(.*)sqp
FinishAction=[!SetVariable SorA 1][!EnableMeasureGroup "StatsA"][!Log "1A - Site checked"]
UpdateRate=582
DecodeCharacterReference=1

[SubsImageA]
Measure=Plugin
Plugin=WebParser
Group=StatsA
URL=[SiteCheckA]
StringIndex=1
;Download=1
;DownloadFile=1.png
OnUpdateAction=[!UpdateMeterGroup "Deta"][!Redraw]
DynamicVariables=1
Disabled=1
RegExpSubstitute=1
Substitute="\n":""

[SubsImageB]
Measure=Plugin
Plugin=WebParser
Group=StatsA
URL=[SiteCheckA]
StringIndex=2
Substitute="?":""

[TestText1]
Meter=String
MeasureName=SubsImageA
MeasureName2=SubsImageB
Group=Deta
FontFace=Arial
FontColor=0,0,0
SolidColor=255,255,255,150
Padding=15,5,15,5
FontSize=10
StringAlign=Left
X=10
Y=100
W=380
H=40
Text=Title: %1#CRLF#Address: https://i.ytimg.com/vi/%2
DynamicVariables=1
;UpdateDivider=-1
AntiAlias=1
Does it for you, too?
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RegExp error (-8)

Post by jsmorley »

Assuming the goal is to display the videos as thumbnail images, and link to the actual video on Youtube, I'd do something like:

Code: Select all

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

[Variables]
upath1=LAGxPeanutPwner
Get=.*width="196".*src="(.*)"

[MeasureTitle]
Measure=WebParser
URL=https://www.youtube.com/user/#upath1#/videos
RegExp=(?siU)<title>(.*)</title>
ForceReload=1
StringIndex=1
Substitute="#CRLF#":""
FinishAction=[!ShowMeter MeterTitle]

[MeterTitle]
Meter=String
MeasureName=MeasureTitle
X=0
Y=120
FontSize=20
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
Hidden=1
LeftMouseUpAction=["https://www.youtube.com/user/#upath1#/videos"]

[MeasureYouTube]
Measure=WebParser
URL=https://www.youtube.com/user/#upath1#/videos
RegExp=(?siU)#Get##Get##Get##Get##Get#
ForceReload=1
DecodeCharacterReference=1

[MeasureImage1Download]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=1
Download=1

[MeasureImage1Link]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=1
RegExpSubstitute=1
Substitute="(?siU)https://i.ytimg.com/vi/(.*)/.*$":"\1"

[MeterImage1Display]
Meter=Image
MeasureName=MeasureImage1Download
W=150
PreserveAspectRatio=1
LeftMouseUpAction=["https://www.youtube.com/watch?v=[MeasureImage1Link]&t=2s"]
DynamicVariables=1

[MeasureImage2Download]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=2
Download=1

[MeasureImage2Link]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=2
RegExpSubstitute=1
Substitute="(?siU)https://i.ytimg.com/vi/(.*)/.*$":"\1"

[MeterImage2Display]
Meter=Image
MeasureName=MeasureImage2Download
X=10R
W=150
PreserveAspectRatio=1
LeftMouseUpAction=["https://www.youtube.com/watch?v=[MeasureImage2Link]&t=2s"]
DynamicVariables=1

[MeasureImage3Download]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=3
Download=1

[MeasureImage3Link]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=3
RegExpSubstitute=1
Substitute="(?siU)https://i.ytimg.com/vi/(.*)/.*$":"\1"

[MeterImage3Display]
Meter=Image
MeasureName=MeasureImage3Download
X=10R
W=150
PreserveAspectRatio=1
LeftMouseUpAction=["https://www.youtube.com/watch?v=[MeasureImage3Link]&t=2s"]
DynamicVariables=1

[MeasureImage4Download]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=4
Download=1

[MeasureImage4Link]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=4
RegExpSubstitute=1
Substitute="(?siU)https://i.ytimg.com/vi/(.*)/.*$":"\1"

[MeterImage4Display]
Meter=Image
MeasureName=MeasureImage4Download
X=10R
W=150
PreserveAspectRatio=1
LeftMouseUpAction=["https://www.youtube.com/watch?v=[MeasureImage4Link]&t=2s"]
DynamicVariables=1

[MeasureImage5Download]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=5
Download=1

[MeasureImage5Link]
Measure=WebParser
URL=[MeasureYouTube]
StringIndex=5
RegExpSubstitute=1
Substitute="(?siU)https://i.ytimg.com/vi/(.*)/.*$":"\1"

[MeterImage5Display]
Meter=Image
MeasureName=MeasureImage5Download
X=10R
W=150
PreserveAspectRatio=1
LeftMouseUpAction=["https://www.youtube.com/watch?v=[MeasureImage5Link]&t=2s"]
DynamicVariables=1
1.png
I refuse to dig through that boatload of javascript and html output to figure out where the single <title> is in relation to the rest... ;-)
You do not have the required permissions to view the files attached to this post.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: RegExp error (-8)

Post by rbriddickk84 »

Okay, i am super-amazed about these helps, i must analize both of the solutions! :D

You guys are awesome!

Jsmorley, to be honest, my old idea was (which was almost worked) that there would be 6 buttons, one button is 250px wide, and 50px heigh. And the buttons are above eachother, and if a new video comes out from one of the youtubers from a list, then the bottom button slides out sideways, the 5 remaining buttons slides down, and the new button slides in on top. :)
This was worked at some point, but Youtube changed it's code, and now nothing works.
The idea is the videos's buttons are displaying the latest video, and the most recently published.

But i really like your work and idea on that, that was another idea, but i didn't thought more forward about it. :)
Most probably some code from it will come in handy, and also Balala managed somehow to make it work, i am very curious about it too!

Thank you very much for the great helps and efforts!
I really appretiate!

I will read and analize everything there, and i respond, probably will takes some time! :D