**------------------------------------------------------------------------------------------------
* @header_start
* WebGrab+Plus ini for grabbing EPG data from TvGuide websites
* @Site: lineup.net.br
* @MinSWversion: V1.57
* @Revision 3 - [??/03/2020] Rain_1 - too many to list here, so I just commented the entire file.
* @Revision 2 - [05/05/2019] jeanniquini - fixes
* @Revision 1 - [23/11/2017] Mat8861 - fixes
* @Revision 0 - [13/10/2016] Blackbear199
* - creation
* @Remarks:
* Rain_1:
* Tvlineup is a little messy, but it's the most complete lineup site I encountered - it has many local stations not present anywhere else.
* However, it seems to screw up the listings deppending on the day - on Sundays, all the 6 days will show the upcoming programs perfectly:
* On Mondays, the "Last Day" EPG will be incorrect and will show last Sundays's show. On Tuesdays, both the last and the penultimate EPG
* will show the previous elapsed days (in this case, Sunday and Monday)
* Basically, the website is a sliding window on shows and the days will cycle forward, instead of new EPG information being loaded. I imagine
* this happens because the website only grabs EPG information on Suindays. I see no way to fix this other than only update the EPG on Sundays.
* @header_end
**------------------------------------------------------------------------------------------------
site {url=lineup.net.br|timezone=Brazil/East|maxdays=6.1|cultureinfo=pt-BR|charset=windows-1252|titlematchfactor=90}
*site {ratingsystem=BR|episodesystem=xmltv_ns}
site {ratingsystem=BR|episodesystem=xmltv_ns}
url_index{url|http://www.lineup.tv.br/gdc.php?Guia=|channel|}
url_index.headers {customheader=Accept-Encoding=gzip,deflate}
*
*urldate.format {daycounter|0}S
* I was wondering if WebGrabPlus was messing up the shows because of this setting and changing to the below setting made no difference.
urldate.format {list|Hoje|Amanhã|{datestring|dd/MM/yyyy}}
*** channel logo (only grabs the first image of multi-logo pages. Example below:
*
*
index_urlchannellogo.scrub {single| | |}
*** split each show from html
*
index_showsplit.scrub {multi||}
*** scrub shows start and end times
*
index_start.scrub {single(separator=" as " include=first)||||}
index_stop.scrub {single(separator=" as " include=last)||||}
*** categories
*
*this is first because movie title splitting is based off its category, so this needs to be set
index_category.scrub {single(separator=" - " include=first2)||||}
*** scrubbing title
* variables used: index_temp_1 = title
* index_temp_2 = subtitle
*
*grab the full title
index_title.scrub {single|
|">||
}
*duplicate all titles into subtitles for better episode information showing on the show page - downside, it repeats the information on browse view.
index_subtitle.modify {set|'index_title'}
*scrub the title and add to the temp1
index_temp_1.scrub {single(separator=": " include=first)|
|">||
}
*scrub subtitle and add to temp2
index_temp_2.scrub {single(separator=": " exclude=first)|
|">||
}
*** split all shows that have : in the title. index_temp_1 will be show name, index_temp_2 will be the description/episode name/teams (when sports)
index_title.modify {set|'index_temp_1'}
index_subtitle.modify {set|'index_temp_2'}
index_subtitle.modify {set(=="")|'index_temp_1'}
*** if its a movie, swap the title (name of the show) and subtitle (name of the movie)
index_title.modify {set('index_category' == "Filme")|'index_temp_2'}
index_subtitle.modify {set('index_category' == "Filme")|'index_temp_1'}
* I couldn't figure out how to do "or" when comparing values and I got tired
index_title.modify {set('index_category' == "Cinema")|'index_temp_2'}
index_subtitle.modify {set('index_category' == "Cinema")|'index_temp_1'}
* clear episode numbers from both just in case
index_title.modify {remove(type=regex)|(?:S\d+)?\s*E\d+\|\s+-\s*S\d+}
index_subtitle.modify {remove(type=regex)|(?:S\d+)?\s*E\d+\|\s+-\s*S\d+}
*** scrubbing description
*
index_description.scrub {single||||}
*** rating system
*
index_rating.scrub {single|src=http://www.lineup.tv.br/images/||.gif|.gif}
index_rating.modify {cleanup(style=upper)}
index_ratingicon.scrub {single|src=|||.gif|align=left}
*** production date and country
index_productiondate.scrub {single(separator=" - " include=4)||||}
index_country.scrub {single(separator=" - " include=3)||||}
index_country.modify {remove| -}
*** scrubbing episode number from title
*
*The format is.
* 2 . 9 . 0/1
* Season{/Number of season in total} . Episode{/Number of Episodes in this season} . {Part number/Number of parts in this episode}
*
* variables used: index_temp_3 = season
* index_temp_4 = episode
* index_temp_5 = season calculation based off index_productiondate
index_temp_3.scrub {regex||S(\d+?)\s*||}
index_temp_4.scrub {regex||(?:S\d+?\s*)?E(\d+)||}
index_temp_3.modify {calculate(not="" format=D)|1 -}
index_temp_4.modify {calculate(not="" format=D)|1 -}
* calculating the year (release) of episodes that have no season information but an episode information (soap operas, for instance)
index_temp_5.modify {calculate('index_productiondate' not="" format=D)|'index_productiondate' 1 -}
* if there's no index_productiondate, set is as (current year -1)
index_temp_5.modify {calculate('index_productiondate' == "" format=date,yyyy)|'now' 1 -}
* set temp3 (season) to 5 (Season from productiondate)
index_temp_3.modify {set(== "")|'index_temp_5'}
* make a xmltv_ns compatible episode numbering system including the previous variables. Thanks whoever made the tv.nu index
index_episode.modify {addend('index_temp_3' not="")|'index_temp_3'}
index_episode.modify {addend|.}
index_episode.modify {addend('index_temp_4' not="")|'index_temp_4'}
index_episode.modify {addend|.}
* if there's no episode number information, clear the entire thing (as it will be identified as a movie with year only information, which we don't need)
index_episode.modify {clear('index_temp_4' == "")}
*** Set original air date for shows that have no Season or Episode information (so plex can identify them as tv shows)
*
* variables used: index_temp_6 = date of the broadcast in yyyy-MM-dd (from 'showdate')
* index_temp_7 = time of the broadcast in hh:mm (from scrubbing)
*
*grab the date from the urldate variable set at the beginning
index_temp_6.modify {calculate(format=date,yyyy-MM-dd)|'showdate'}
*grab the hh:mm information from the text in the page
index_temp_7.scrub {single(separator=" as " include=first)||||}
*set those variables as the "original-air-date" listing
index_episode.modify {set(== "")|'index_temp_6' 'index_temp_7':00(system=original-air-date)}
* removes episode information, most likely the original air date, i can probably add that on the modify string or, in reality, just leave it, as year only entries are treated as movies anyway
index_episode.modify {clear('index_category' == "Filme")}
index_episode.modify {clear('index_category' == "Cinema")}
*** Video quality for plex
*
index_videoaspect.modify {set|16:9}
index_videoquality.modify {set|HDTV}
*** Nothing is set to new ever. We don't have that information and the "NEW" flag on Plex annoys me
index_previousshown.modify {addend|true}
*** categories
* replace categories text if you need to. No longer required but will leave commented for future use
*
*index_category.scrub {single(separator=" - " include=first2)||||}
*change categories to pre-determined list, if necessary
*index_category.modify {replace(type=regex)|"^Épico$"|Historical movie}
*index_category.modify {replace(type=regex)|"^Ação$"|Movie / drama}
*index_category.modify {replace(type=regex)|"^Animação$"|Cartoon}
*index_category.modify {replace(type=regex)|"^Automobilismo$"|Sports}
*index_category.modify {replace(type=regex)|"^Aventura$"|Adventure}
*index_category.modify {replace(type=regex)|"^Basquete$"|Team sports}
*index_category.modify {replace(type=regex)|"^Cinema$"|Cinema}
*index_category.modify {replace(type=regex)|"^Comédia$"|Comedy}
*index_category.modify {replace(type=regex)|"^Comportamento$"|Social}
*index_category.modify {replace(type=regex)|"^Culinária$"|Cooking}
*index_category.modify {replace(type=regex)|"^Cultural$"|Culture}
*index_category.modify {replace(type=regex)|"^Debate$"|Social}
*index_category.modify {replace(type=regex)|"^Desenho$"|Cartoon}
*index_category.modify {replace(type=regex)|"^Diversos$"|Variety}
*index_category.modify {replace(type=regex)|"^Documentário$"|Documentary}
*index_category.modify {replace(type=regex)|"^Drama$"|Drama}
*index_category.modify {replace(type=regex)|"^Ecologia$"|Nature}
*index_category.modify {replace(type=regex)|"^Educativo$"|Educational}
*index_category.modify {replace(type=regex)|"^Entrevista$"|Interview}
*index_category.modify {replace(type=regex)|"^Espetáculo$"|Show}
*index_category.modify {replace(type=regex)|"^Esporte/Diversos$"|Sports}
*index_category.modify {replace(type=regex)|"^Esporte$"|Sports}
*index_category.modify {replace(type=regex)|"^Esportivo$"|Sports magazines}
*index_category.modify {replace(type=regex)|"^Ficção$"|Science fiction}
*index_category.modify {replace(type=regex)|"^Filme$"|Movie / drama}
*index_category.modify {replace(type=regex)|"^Futebol$"|Soccer}
*index_category.modify {replace(type=regex)|"^Histórica$"|Historical movie}
*index_category.modify {replace(type=regex)|"^Infantil/Programa$"|Children's / Youth programs}
*index_category.modify {replace(type=regex)|"^Infantil$"|Children's / Youth programs}
*index_category.modify {replace(type=regex)|"^Informativo$"|Informational}
*index_category.modify {replace(type=regex)|"^Investigação$"|Detective, Thriller}
*index_category.modify {replace(type=regex)|"^Jornalismo/Esportivo$"|Sports}
*index_category.modify {replace(type=regex)|"^Jornalismo/Informativo$"|News magazine}
*index_category.modify {replace(type=regex)|"^Jornalismo$"|News}
*index_category.modify {replace(type=regex)|"^Juvenil$"| Children's / Youth programs}
*index_category.modify {replace(type=regex)|"^Meio Ambiente$"|Nature}
*index_category.modify {replace(type=regex)|"^Musical$"|Musical}
*index_category.modify {replace(type=regex)|"^Novela$"|Show / Game show}
*index_category.modify {replace(type=regex)|"^Policial$"|Detective}
*index_category.modify {replace(type=regex)|"^Programa$"|Show}
*index_category.modify {replace(type=regex)|"^Reality Show$"|Show}
*index_category.modify {replace(type=regex)|"^Religião$"|Religion}
*index_category.modify {replace(type=regex)|"^Revista Feminina$"|Magazines}
*index_category.modify {replace(type=regex)|"^Séries/Documentário$"|Documentary}
*index_category.modify {replace(type=regex)|"^Séries$"|Show}
*index_category.modify {replace(type=regex)|"^Saúde$"|Fitness and health}
*index_category.modify {replace(type=regex)|"^Suspense$"|Thriller}
*index_category.modify {replace(type=regex)|"^Talk Show$"|Talk Show}
*index_category.modify {replace(type=regex)|"^Variedades/Comportamento$"|Variety show}
*index_category.modify {replace(type=regex)|"^Variedades/Diversos$"|Variety show}
*index_category.modify {replace(type=regex)|"^Variedades/Infantil$"|Children's / Youth programs}
*index_category.modify {replace(type=regex)|"^Variedades/Musical$"|Music}
*index_category.modify {replace(type=regex)|"^Variedades/Religião$"|Religion}
*index_category.modify {replace(type=regex)|"^Variedades/Saúde$"|Fitness and health}
*index_category.modify {replace(type=regex)|"^Variedades/Viagem$"|Tourism / Travel}
*index_category.modify {replace(type=regex)|"^Variedades$"|Variety show}
*index_category.modify {replace(type=regex)|"^Viagem$"|Tourism / Travel}
*
** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
**
** This is covered, for me, on an external python script that's specific to my list of channels.
** I don't know how to fix this on a more generic pattern.
**
** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
**
** @auto_xml_channel_start
*url_index {url|http://www.lineup.tv.br/gdc.php}
*index_site_id.scrub {regex||[^<]*<\/a>||}
*index_site_channel.scrub {regex||([^<]*)<\/a>||}
*index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")}
** @auto_xml_channel_end