*** £$π Functions (WIKI) ***
..
- HomePage
- Setup
- Basics
-
Functions
- Items
- Channels
- Listrepeat
- Multilink
- EPG
- External links
- External calls
- Regex
- Conditional DoRegex
- Python function
- Python codeblock
- Unpacker
- UnWise
- Sawlive
- Cloud Flare
- Sucuri Proxy
- Captcha
- Plugins
- JSON-RPC
- Rawpost
- Headers
- Proxy
- Cookies & Sessions
- Redirection
- Parental block
- ViewMode
- LSDirect
- LiveResolver
- ResolveUrl
- F4µ
- Inputstream
- SLProxy
- Encryption
- Examples
- FAQ?
- Developers
- Release Notes?
- ChangeLog
.
*** Doc. Kodi & PYthon ***
..
Python & Modules PY
.
.
.
.
(Video) Cache Kodi
.
.
.
Addons Kodi
.
.
.
Addons Kodi
.
.
*** GITHUB ***
..
URLresolver (J.S.) [GIT] +
.
.
.
URLresolver (elD.) [GIT] -
.
.
URLresolver (tvA.) [GIT] -
.
.
.
.
Cloudflare (external) [GIT]
.
.
.
*** Associated ***
.Pastebin Your list online
.
mediafire Upload Files
.
imgur Upload Pics
lyngsat TV logos collection
transparent .png
.
http://hola.org free? VPN
Hola.apk free? VPN App.
.
hidester- free Proxy
.
webgrabplus EPG - Eng
xmltv EPG - Fr
kazer EPG - Fr
.
.wordreference Traduction
.
mail.com (fast sign-in)
.
.
Regex Within a Channel
Regex Within a Channel
Hi All
I know this has been made to be suited to be more a tutorial page but was wondering if this is possible to do?
I have taken the example for the channel making
So basically if the channel is live it will show live now in the title if not it will not show anything.
Hope it makes sence
Thanks
I know this has been made to be suited to be more a tutorial page but was wondering if this is possible to do?
I have taken the example for the channel making
- Code:
<channels>
<channel>
<name>New Hope Church</name>
<regex>
<name>yt-badge-live</name
<express>[color=#FF0000]dont know what to put here lol but if this is on the yt page yt-badge-live" >Live now Then it should place it in the title[/color]</express>
<thumbnail>http://www.findjesus.tv/picture_library/findJesus.jpg</thumbnail>
<fanart>http://goo.gl/dtB8T9</fanart>
<items>
<item>
<title>New Hope SDA Church Live Stream $dorege[yt-badge-live]</title>
<link>plugin://plugin.video.youtube/play/?video_id=$doregex[getID]</link>
<regex>
<name>getID</name>
<expres>data-context-item-id="([^"]+)</expres>
<page>https://www.youtube.com/channel/UCVAmiFwV2Azq4vZ5h4bVj5A</page>
</regex>
<thumbnail>http://www.findjesus.tv/picture_library/findJesus.jpg</thumbnail>
<fanart>http://goo.gl/dtB8T9</fanart>
</item>
<item>
<title>Sermons</title>
<link>ignorme</link>
<jsonrpc>plugin://plugin.video.youtube/channel/UCVAmiFwV2Azq4vZ5h4bVj5A/playlist/PLwRbRhLoHaii8jAU8XXlCo1ZMEsr0vRhC/</jsonrpc>
<thumbnail>https://i.ytimg.com/vi/b2yFnRyw558/hqdefault.jpg</thumbnail>
</item>
</items>
</channel>
So basically if the channel is live it will show live now in the title if not it will not show anything.
Hope it makes sence
Thanks
retrorat1- Messages : 23
Date d'inscription : 2017-04-17
Re: Regex Within a Channel
no regex in a channel, but in an item
no $doregex in a <title>
no double s, in <expres>
no ... way ! That would be easier to find jesus for true ...
I don't know exactly what you want, but you might considere to build an expres that only grabs title that include the word Live
something like that:
<expres> .............(.*?Live.*?)............
no $doregex in a <title>
no double s, in <expres>
no ... way ! That would be easier to find jesus for true ...

I don't know exactly what you want, but you might considere to build an expres that only grabs title that include the word Live
something like that:
<expres> .............(.*?Live.*?)............
jujuuj- Messages : 249
Date d'inscription : 2017-03-28
Re: Regex Within a Channel
My Addon is for live streaming of churches there are over 100 churches from Australia to US a lot of them stream from you tube which has the facility to show that the channel is live.
I follow as many as i can and add "Now Live" in the title but it is not practical so was looking for an easy way.
The principle is simple if yt-badge-live present show title 2 if not show tittle 1 lol
<title>Hope Church</title>
<title2>Hope Church Live Now</title2>
I know it is said that it cannot be done this way but there must be some way to incorporate it.
I follow as many as i can and add "Now Live" in the title but it is not practical so was looking for an easy way.
The principle is simple if yt-badge-live present show title 2 if not show tittle 1 lol
<title>Hope Church</title>
<title2>Hope Church Live Now</title2>
I know it is said that it cannot be done this way but there must be some way to incorporate it.
retrorat1- Messages : 23
Date d'inscription : 2017-04-17
Re: Regex Within a Channel
Newest verion of LSP allows you to call regex from title
https://www.tvaddons.ag/forums/shanis-addon-repository/24190-release-livestreamspro-225.html#post412509
Thanks Retrorat1 for pushing the issue on this with Shani. I've been wanting this added to LSP for a long time. Now if only you could call regex from the info and thumbnail tags.
https://www.tvaddons.ag/forums/shanis-addon-repository/24190-release-livestreamspro-225.html#post412509
Thanks Retrorat1 for pushing the issue on this with Shani. I've been wanting this added to LSP for a long time. Now if only you could call regex from the info and thumbnail tags.
twogun- Messages : 33
Date d'inscription : 2017-04-03
Re: Regex Within a Channel
Lol Yes Twogun this is the 3rd time I have asked for it but this time I think I made it a bit more clearer what I needed.
But I am still stuck as to what expression to use
So it might have to be with something along this line(which I have no clue about)
IDs = re.findall('(?s)Live now.*?yt-badge-live".+?>(?:Live.*?)
if i am not mistaken
But if not live it shouldnt give an error but just play as normal , which will be the last uploaded video.
Is this right or am I totally overthinking this?
Thanks
But I am still stuck as to what expression to use
- Code:
<item>
<title>Amazing Facts TV [COLOR yellow]$doregex[getliveflag][/COLOR]</title>
<link>plugin://plugin.video.youtube/play/?video_id=$doregex[getID]</link>
<regex>
<name>getliveflag</name>
<expres>span class="yt-badge</expres>
<page>https://www.youtube.com/channel/UCVAmiFwV2Azq4vZ5h4bVj5A</page>
</regex>
<regex>
<name>getID</name>
<expres>data-context-item-id="([^"]+)</expres>
<page>https://www.youtube.com/channel/UC6VJE6cD8ZPpe6ZOtVtlBTA</page>
</regex>
<thumbnail>https://lh3.googleusercontent.com/LtoXBkeNAb_AbqEn29AFWkQW5fc1uvblpvY-tV_O4nS8plcECNXaWJeUgsaTuX5O-dtd_w=s85</thumbnail>
<fanart>http://fluidm.in/wp-content/uploads/2015/11/television.jpg</fanart>
</item>
So it might have to be with something along this line(which I have no clue about)
IDs = re.findall('(?s)Live now.*?yt-badge-live".+?>(?:Live.*?)
if i am not mistaken
But if not live it shouldnt give an error but just play as normal , which will be the last uploaded video.
Is this right or am I totally overthinking this?
Thanks
retrorat1- Messages : 23
Date d'inscription : 2017-04-17
Re: Regex Within a Channel
Try this. I'm not sure what the page looks like when the stream is live, but I compared it to the NASA Youtube channel which is live, and I believe this should work. The getliveflag regex return either Live Now, or Archive. Depending on the status. You can change the 'Archive' to any other message you want (most recent, sermon, service, etc) or leave it empty between the ' ' if do not want the status returned on archived videos.
Hope this works for you.
Hope this works for you.
- Code:
<item>
<title>Amazing Facts TV [COLOR yellow] ($doregex[getliveflag])[/COLOR]</title>
<link>plugin://plugin.video.youtube/play/?video_id=$doregex[getID]</link>
<regex>
<name>getliveflag</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
import re
try:
return re.findall('yt-badge-live" \W(Live now)', page_data)[0]
except:
return 'Archive'
]]></expres>
<page>https://www.youtube.com/channel/UCVAmiFwV2Azq4vZ5h4bVj5A</page>
</regex>
<regex>
<name>getID</name>
<expres>data-context-item-id="([^"]+)</expres>
<page>https://www.youtube.com/channel/UC6VJE6cD8ZPpe6ZOtVtlBTA</page>
</regex>
<thumbnail>https://lh3.googleusercontent.com/LtoXBkeNAb_AbqEn29AFWkQW5fc1uvblpvY-tV_O4nS8plcECNXaWJeUgsaTuX5O-dtd_w=s85</thumbnail>
<fanart>http://fluidm.in/wp-content/uploads/2015/11/television.jpg</fanart>
</item>
twogun- Messages : 33
Date d'inscription : 2017-04-03
Re: Regex Within a Channel
Twogun It worked perfectly in LSP. Anyone knows what file was added to make this work , I might need to add the same file to my addon as it pulls but without the desired results.
It displays Amazing Facts TV :$doregex[getliveflag] in my addon, but in LSP Amazing Facts TV :Live Now which is what I had asked for lol.
It displays Amazing Facts TV :$doregex[getliveflag] in my addon, but in LSP Amazing Facts TV :Live Now which is what I had asked for lol.
retrorat1- Messages : 23
Date d'inscription : 2017-04-17
Re: Regex Within a Channel
- Code:
<channels>
<channel>
<name>Amazing Facts TV</name>
<thumbnail>https://lh3.googleusercontent.com/LtoXBkeNAb_AbqEn29AFWkQW5fc1uvblpvY-tV_O4nS8plcECNXaWJeUgsaTuX5O-dtd_w=s85</thumbnail>
<fanart>http://fluidm.in/wp-content/uploads/2015/11/television.jpg</fanart>
<items>
<item>
<title>Amazing Facts TV [COLOR green] :$doregex[getliveflag][/COLOR]</title>
<link>plugin://plugin.video.youtube/play/?video_id=$doregex[getID]</link>
<regex>
<name>getliveflag</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
import re
try:
return re.findall('yt-badge-live" \W(Live now)', page_data)[0]
except:
return 'Last Uploaded Video'
]]></expres>
<page>https://www.youtube.com/channel/UC6VJE6cD8ZPpe6ZOtVtlBTA</page>
</regex>
<regex>
<name>getID</name>
<expres>data-context-item-id="([^"]+)</expres>
<page>https://www.youtube.com/channel/UC6VJE6cD8ZPpe6ZOtVtlBTA</page>
</regex>
<thumbnail>https://lh3.googleusercontent.com/LtoXBkeNAb_AbqEn29AFWkQW5fc1uvblpvY-tV_O4nS8plcECNXaWJeUgsaTuX5O-dtd_w=s85</thumbnail>
<fanart>http://fluidm.in/wp-content/uploads/2015/11/television.jpg</fanart>
</item>
<item>
<title>Facts of Faith</title>
<link>ignorme</link>
<jsonrpc>plugin://plugin.video.youtube/channel/UCVAmiFwV2Azq4vZ5h4bVj5A/playlist/PL4PwK7QaFAuiKTiLqqE0f0hFKCoGWM6cI/</jsonrpc>
<thumbnail>https://lh3.googleusercontent.com/YRBV2rEjzYxQvB3FUL7Kk4xOfb9-GiBdaYIHhKvYEfq6Il0cF3mY4XqcJnpH5UKM40jW=s152</thumbnail>
</item>
</items>
</channel>
retrorat1- Messages : 23
Date d'inscription : 2017-04-17
Re: Regex Within a Channel
twogun wrote:Newest verion of LSP allows you to call regex from title
https://www.tvaddons.ag/forums/shanis-addon-repository/24190-release-livestreamspro-225.html#post412509
Thanks Retrorat1 for pushing the issue on this with Shani. I've been wanting this added to LSP for a long time. Now if only you could call regex from the info and thumbnail tags.
oh really !
Thanks shani ! ... And both of you for info and examples
jujuuj- Messages : 249
Date d'inscription : 2017-03-28
Re: Regex Within a Channel
retrorat1 wrote:Twogun It worked perfectly in LSP. Anyone knows what file was added to make this work , I might need to add the same file to my addon as it pulls but without the desired results.
It displays Amazing Facts TV :$doregex[getliveflag] in my addon, but in LSP Amazing Facts TV :Live Now which is what I had asked for lol.
it only works with the newest LSP ... So you should compare the zips ... or directly ask to shani ...
jujuuj- Messages : 249
Date d'inscription : 2017-03-28
Re: Regex Within a Channel
@Retrorat1
I took the time to backported Shani's regex in title/thumbnail code to your plugin's default.py files.
Hopefully this will be helpful. Of course you still have the limitation of not being able to use python block so I rewrote the youtube regex to avoid it.
i gave it a quick test and everything seems to work fine, but you probably want to give it a good test before implementing. Just to make sure I didn't break anything. Not really a concern, but It doesn't hurt to be careful.
New py:
raw:
https://pastebin.com/raw/5t0er6Km
non-raw (in case you want to use the 'download' link):
https://pastebin.com/5t0er6Km
New Youtube (live now) title regex:
latter,
2GUN
I took the time to backported Shani's regex in title/thumbnail code to your plugin's default.py files.
Hopefully this will be helpful. Of course you still have the limitation of not being able to use python block so I rewrote the youtube regex to avoid it.
i gave it a quick test and everything seems to work fine, but you probably want to give it a good test before implementing. Just to make sure I didn't break anything. Not really a concern, but It doesn't hurt to be careful.
New py:
raw:
https://pastebin.com/raw/5t0er6Km
non-raw (in case you want to use the 'download' link):
https://pastebin.com/5t0er6Km
New Youtube (live now) title regex:
- Code:
<item>
<title>Amazing Facts TV [COLOR yellow] ($doregex[online])[/COLOR]</title>
<link>plugin://plugin.video.youtube/play/?video_id=$doregex[getID]</link>
<regex>
<name>online</name>
<expres>$pyFunction: 'Live now' if '$doregex[live]'=='Live now' else 'Archive'</expres>
<page></page>
</regex>
<regex>
<name>live</name>
<expres>yt-badge-live" \W(Live now)</expres>
<page>https://www.youtube.com/channel/UC6VJE6cD8ZPpe6ZOtVtlBTA</page>
</regex>
<regex>
<name>getID</name>
<expres>data-context-item-id="([^"]+)</expres>
<page>https://www.youtube.com/channel/UC6VJE6cD8ZPpe6ZOtVtlBTA</page>
</regex>
<thumbnail>https://lh3.googleusercontent.com/LtoXBkeNAb_AbqEn29AFWkQW5fc1uvblpvY-tV_O4nS8plcECNXaWJeUgsaTuX5O-dtd_w=s85</thumbnail>
<fanart>http://fluidm.in/wp-content/uploads/2015/11/television.jpg</fanart>
</item>
latter,
2GUN
twogun- Messages : 33
Date d'inscription : 2017-04-03
Re: Regex Within a Channel
Extremely Sorry for not responding earlier , I was tied up , Will try it today and get back to you.
Thanks ever so much for the work you have helped me do.
Thanks ever so much for the work you have helped me do.
retrorat1- Messages : 23
Date d'inscription : 2017-04-17
Re: Regex Within a Channel
no problemo amigo ! life is like that ...
jujuuj- Messages : 249
Date d'inscription : 2017-03-28
Re: Regex Within a Channel
Twogun , Worked perfectly Thank you I can sleep a bit more now then staying up to type live now for each channel like i did in the past.
done Oceanic countries and Asia already with your new code now Europe and the Us to do 87 in total lol. but should be done by the time the first service starts Friday night in New Zealand.
Thank you once again
PS did you find how to call regex form info and thumbnails yet?
done Oceanic countries and Asia already with your new code now Europe and the Us to do 87 in total lol. but should be done by the time the first service starts Friday night in New Zealand.
Thank you once again
PS did you find how to call regex form info and thumbnails yet?
retrorat1- Messages : 23
Date d'inscription : 2017-04-17
Re: Regex Within a Channel
@Retrorat1
I'm glad it works for you.
Regex in Thumbnails was introduced at the same time Regex in Title was. I had overlooked it. Regex is still not supported in info tags.
Also regex in Thumbnail will work your updated pluggin. For the youtube just use the $doregex[getID] like this:
I'm glad it works for you.
Regex in Thumbnails was introduced at the same time Regex in Title was. I had overlooked it. Regex is still not supported in info tags.
Also regex in Thumbnail will work your updated pluggin. For the youtube just use the $doregex[getID] like this:
- Code:
<thumbnail>https://i.ytimg.com/vi/$doregex[getID]/hqdefault.jpg</thumbnail>
twogun- Messages : 33
Date d'inscription : 2017-04-03
Permissions in this forum:
You cannot reply to topics in this forum
|
|