Kodi Community Forum
Regular Expressions - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Regular Expressions (/showthread.php?tid=25349)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17


RE: Regular Expressions - sjorge - 2012-12-30

Thank you scudlee, that regex indeed works fine from my quick look. The missings ones I know of were now found.
I'll look into the AniDB Mod later, it seems interesting.

Thanks again!


RE: Regular Expressions - pmolson - 2013-01-07

Hello RegEx Gurus,

I hope you guys can help me understand how to apply the following (by example) to various sites/streams...I guess one of the pre-requisites to help out would be to have RegEx expertise as well as flash video streams, source code understanding, and rtmp savoir-faire Smile

http://forum.xbmc.org/showthread.php?tid=97116&pid=1274417#pid1274417 (Courtesy of C420)

I love this idea/tool & I'd like to master it!!!

I have downloaded C420's LiveStreams addon and it works GREAT! I have since tried applying the same concept to other sites, but could not get them to work!!! I've contacted C420 and he was very helpful and patient with a couple of extra examples I've sent him, but then right b4 the holidays, he went radio-silent on me!!! I guess he realized I was a just rookie who asks too many questions Smile

One of the areas I need help with is how to get the <page> section (in C420's code), as I know it differs from one site or stream to the other.

I do have tools like wireshark, url helper, and firebug, a firefox's addon to help extract source code, but I often get stuck trying to get the correct regex syntax, what exactly to look for? and where?...I know there is NO "one size fits all "of this sort of things, but a step by step generic FLOW or PROCEDURE would be nice...

Please advise if you can help me out... and I can PM you a couple of streams/links I need some hand-holding with...

Thank You In Advance!


RE: Regular Expressions - derwildemann - 2013-12-01

I have been trying for more than a week to get raspbmc read and understand my names.

I have also read through this thread but still I can't find out how to get it to work.

I have been using a WDTV player and have developed quite some 5000 move sheets for the movie and TV show folders as well as for the video files themselves, so I am quite a bit reluctant to rename all of them, so they would work for either, the WDTV player as for my Pi with raspbmc.

First, I can't name every season folder below a TV show as 'season 01' and so on as the respective season sheet for that folder, that the WDTV player understands has to be unique, if not the WDTV player would not show the correct season sheet but the first one named 'season 01_sheet.jpg' regardless the TV show.

I also have an issue with the movie file convention.

Here is my own naming convention:

Root
├ VIDEO
│ ├ 1 SERIES
│ │ ├ Arrow
│ │ │ ├ Arrow S01
│ │ │ │ ├ Arrow S01E01 Pilot.mp4
│ │ │ │ ├ Arrow S01E01 Pilot.en.srt
: : : : :
: : : : :
│ │ │ ├ Arrow S02
│ │ │ │ ├ Arrow S02E01 City Of Heroes.mp4
│ │ │ │ ├ Arrow S02E01 City Of Heroes.en.srt
: : : : :
: : : : :
│ │ │ ├ Boardwalk Empire
│ │ │ │ ├ Boardwalk Empire S01
│ │ │ │ ├ Boardwalk Empire S02
│ │ │ │ ├ Boardwalk Empire S03
: : : : :
: : : : :
│ ├ 2 MOVIES
│ │ ├ 1 new movies
│ │ │ ├ 2 Guns - 2013
│ │ │ │ ├ 2Guns_2013_en_109min.mkv
│ │ │ │ └ 2Guns_2013_en_109min.en.srt
│ │ │ ├ Elysium - 2013
│ │ │ │ ├ Elysium_2013_en_109min.mkv
│ │ │ │ └ Elysium_2013_en_109min.en.srt
: : : :
: : : :

So I came across the 'advancedsettings.xml' file and also saw the 'Regular Expressions' but I can't figure out how to use them to get my names being understood by raspbmc.

I also am not sure if <tvshowmatching> would help me not only with the TV shows but also with my movies.

I saw this but am not sure how to use the tags:
<tvshowmatching>
    <regexp>[Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+)([^\\/]*)$</regexp> <!-- foo.s01.e01, foo.s01_e01, S01E02 foo, S01 - E02 -->
    <regexp>[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$</regexp> <!-- foo.ep01, foo.EP_01 -->
    <regexp>([0-9]{4})[\.-]([0-9]{2})[\.-]([0-9]{2})</regexp> <!-- foo.yyyy.mm.dd.* (byDate=true) -->
    <regexp>([0-9]{2})[\.-]([0-9]{2})[\.-]([0-9]{4})</regexp> <!-- foo.mm.dd.yyyy.* (byDate=true) -->
    <regexp>[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)$</regexp> <!-- foo.1x09* or just /1x09* -->
    <regexp>[\\/\._ -]([0-9]+)([0-9][0-9])([\._ -][^\\/]*)$</regexp> <!-- foo.103*, 103 foo -->
    <regexp>[\/._ -]p(?:ar)?t[_. -]()([ivx]+)([._ -][^\/]*)$</regexp> <!-- Part I, Pt.VI -->
</tvshowmatching>

In fact, in case of a TV show file, the video file name already contains all info but, as I omitted spaces in earlier TV shows to separate multiple word titles and also used underscore instead of a space to separate the show name from the season/episode info, I guess the best is to get the show name from the top folder.

All these name types appear in my files:

Boardwalk Empire S01E02 The Ivory Tower.avi
GOT_S01E01 Winter is Coming.avi ( Game of Thrones)
FallingSkies_S01E02 Prisoner of War.avi

Could anyone explain to me what these tags do in detail so I could try to put them together? Or, maybe if this is too extensive, could anyone just give me the code that attends to my naming convention?

I could however rename all the show names in front of the season/episode info to i.e.

TV show name SxxExx Episode Name.avi

or

TV show name_SxxExx Episode Name.avi

This would be quite some work but it would be doable, however the more elegant way is to get the right regEx to do recognize everything.


RE: Regular Expressions - bhatti00 - 2014-03-28

anyone help me with some regex code?

this expression used to work but now is failing because of an extra ]]> at the end of the stream hash
how can i get it to read the whole
Code:
rtmp://server.live.net/liveorigin/play1?token=c3RhcnRfdGltZT0yMDE0MDMyNzIyMDI1NSZlbmRfdGltZT0yMDE0MDMyNzIyMDM1NSZk​aWdlc3Q9NWU2NmNjMzE5MGZjMmEyNWIwYzMzMWExMjQ4ZjIyZWQ=
without the extra bit? this is the expression which used to work for the following but now it doesnt' (rtmp://[^<]+)

Code:
<xml>
<version>1.0</version>
<restart_app/>
<items>
<item>
<type>RTMP</type>
<link>
<![CDATA[
rtmp://server.live.net/liveorigin/play1?token=c3RhcnRfdGltZT0yMDE0MDMyNzIyMDI1NSZlbmRfdGltZT0yMDE0MDMyNzIyMDM1NSZk​aWdlc3Q9NWU2NmNjMzE5MGZjMmEyNWIwYzMzMWExMjQ4ZjIyZWQ=
]]>
</link>
<status>1</status>
<geofilter_allowed>1</geofilter_allowed>
<sub_status>1</sub_status>
</item>
</items>
</xml>

any help much appreciated


RE: Regular Expressions - ramicio - 2016-04-29

Can someone please help me with this? I really don't understand these regular expressions. I just don't get it. If you don't want to help me, please don't jump down my throat, please just ignore this post. I name my shows as follows:

Show_name/season#-episode#(+extra_episode#) - Episode_name

Some shows just do not match the scrapers, so I would like to just not use them, and let the program just get the info from the filenames. I couldn't care less about the content that scrapers give me. The extra episode thing is there in the off-chance that there are two episodes combined into one file. They do this on disc, but not when they air things, so this is why my stuff just doesn't match scrapers, because they are from physical discs, not pirated TV caps. I really just don't get how to incorporate the extra episode part.

EDIT: I guess this isn't going to ever do what I want. All I want is for the program to get the show name, the season number, the episode number(s), and the title, and do its own breaking-down of things, all from the file name. That's as clearly as I can explain it. I don't want to use scrapers, because they don't work, even when I try to name things correctly, they find files that aren't even there, and it's just a huge mess. I don't want to use the file view, because it just lists all of the files and shows the extension, and doesn't break things down by season. I will pay someone money if they help me with this, if it's even possible to get the behavior that I want. I don't need posters or anything like that. Just for the program to structure things based on the path and name.


RE: Regular Expressions - TassMetal - 2020-04-10

.post deleted