epgsearch(1) | Epgsearch Version 2.4.0 | epgsearch(1) |
epgsearch - Searchtimer and replacement of the VDR program menu
EPG-Search can be used as a replacement for the default schedules menu entry. It looks like the standard schedules menu, but adds some additional functions:
- Commands for EPG entries with 5 built-in commands like 'show repeats', 'create search'. One can add own commands for other needs, like adding a VDRAdmin auto-timer. - Add up to 4 user-defined times to 'now' and 'next' and an optional favorites menu - Searching the EPG: Create reusable queries, which can also be used as 'search timers'. - Search timers: Search for broadcasts in the background and add a timer if one matches (similar to VDRAdmin's auto-timers) or simply make an announcement about it via OSD - Avoid double recordings of the same event * timer preview * recognition of broken recordings * fuzzy event comparison - Progress bar in 'What's on now' and 'What's on next' - Shift the time displayed by key press, e.g. 'What's on now' + 30 minutes - Start menu can be setup between 'Schedule' or 'What's on now' - background check for timer conflicts with a timer conflict manager - detailed EPG menu (summary) allows jumping to the next/previous event - support for extended EPG info for search timers - extension of the timer edit menu with a directory item, user defined weekday selection and a subtitle completion. - Timer conflict check, informs you over the OSD about conflicts - Timer conflict menu, show detailed information about the conflicts and let you resolve them - Email notifications about search timer updates and timer conflicts
Parts of the sources are based on the repeating-ECG patch from Gerhard Steiner, who gave me the permission to use them. Thanks for his work!
1. Description 1.1 Menu commands 1.2 Menu search 1.2.1 Menu edit search 1.2.2 Menu search results 1.3 Extended 'now' and 'next' 1.4 Menu setup 2. Search timers 2.1 'Avoid repeats' - internals 2.2 How do we compare two events? 2.3 How and when do we compare? 3. Usage from other plugins or scripts 4. Using extended EPG info 5. Replacing the standard schedule menu 6. Add-ons
At first glance EPG-Search looks like the schedules menu entry of VDR. By pressing the key '0', one can toggle the bottom color keys to access additional functions (the default assignment of the color keys can be adjusted by setup):
This menu displays commands that can be executed on the current item. There are 8 built-in commands:
- Repeats: Searches for repeats - Record - Switch - Create search Switches to search menu and adds a new search with the name of the current item (to avoid editing the name manually) - Search in recordings: Search the recordings for a broadcast with the same name - Mark as 'already recorded': This puts the selected event in the file epgsearchdone.data and instructs epgsearch to avoid recording this event if an according search timer is set to "avoid repeats". An already created timer will be automatically removed with the next search timer update. - Add/Remove to/from switch list?: Controls the switch list. If there is an event in the switch list, epgsearch will announce it and switch to the event before it starts. To access the complete switch list, call 'Search/Actions/Switch list'. - Create blacklist: A blacklist is used to ignore events when using search timers. A search timer can be setup to ignore events from arbitrary blacklists.
You can add your own commands to this menu by editing the file epgsearchcmds.conf in the epgsearch config directory. There's a sample conf file with some sample commands (see directory 'scripts', taken from vdr-wiki.de, thanks to the authors).
The format of the file is the same as VDR's commands.conf or reccmds.conf. When a command is executed the following parameters are passed to it:
$1: the title of the EPG entry $2: the start time of the EPG entry as time_t value (like in the shutdown script) $3: the end time $4: the channel number of the EPG entry $5: the long channel name of the EPG entry $6: the subtitle of the EPG entry, "" if not present
To execute a command from the main menu you can also press its associated number without opening the commands menu.
Here you can add, edit, delete and execute your own queries on the EPG. The usage and behavior of this menu is similar to VDR's timer menu.
1.2.1 Menu edit search
Most things in this menu are quite clear, so only some notes on:
With 'blue' you can also select a template for the new search. If one of the templates is set to default, new searches will automatically get the settings of the default template.
Note: fuzzy searching is limited to 32 chars!
With 'Regular expression' you can setup a regular expression as search term. You don't need a leading and trailing '/' in the expression. By default these are POSIX extended regular expressions. If you like to have Herl compatible regular expression, simply edit the plugins Makefile and uncomment '#REGEXLIB = pcre' to 'REGEXLIB = pcre' (you will need pcreposix installed, comes with libpcre from www.pcre.org, but it's already part of most distributions).
See also epgsearch(4) 'Description of the search process'.
Channel groups (e.g. sport channels or Pay-TV channels) can be managed with a sub-menu called with 'blue'.
ATTENTION: After changing the channels order please check the settings of your search timers!
You'll find the user-defined selection in the list after Friday.
See also epgsearch(4) 'Using variables in the directory entry of a search timer'.
For comparison all parts of the description, that look like a category value, are removed first. The remaining text will be compared. If this is similar at the value of the next option (regarding the Levinshtein-Distance algorithm) then it will be accepted as equal.
* after x recordings, or * after x days after the first recording
Only complete recordings are counted. The deletion is executed directly after the correspondig recording
To toggle the flag 'Use as search timer' without editing the search entry you can use the key '2'. This will call directly the second command of the command menu.
1.2.2 Menu search results
This menu displays the search results. A 'T' lets you know, that there is already a timer for the event. A 't' means that there's only a partial timer for it, as in standard schedules menu.
By setup, one can add up to 4 additional times to extend the green button, e.g. 'afternoon', 'prime time', 'late night'. Times, that are already passed, are skipped (you will not get 'afternoon' at evening) with the exception that a time will be displayed for the next day, if it is less then 20h in the future. In these menus you can shift the currently displayed time by pressing FastRew or FastFwd to move back and forward in time. If you don't have these keys on your remote, you can access this function by pressing '0' to toggle the green and yellow button to '<<' and '>>'. This toggling can be adjusted by setup.
You can display a progress bar in 'now' and 'next'.
Furthermore you can enable in the setup an favorites list. You can configure your searchtimers ("Use in favorite list") to display their results in you favorite list. This list display event in the next 24 hours ordered by time.
1.4.1 General
1.4.2 EPG menus
1.4.3 User-defined EPG times
1.4.4 Timer programming
Not all channels provide a proper event ID, so you can setup the default for each channel here. When programming a manual timer, this default use used in epgsearch's own timer edit menu.
1.4.5 Search and search timers
Search timers will always be created local, even if SVDRPDefaulthost is set to a different host.
Important: if you get your EPG from external sources make sure that search timer updates are disabled while your EPG is updated. The reason for this is that epgsearch will remove timers without events assigned to them. This situation can exist while the new EPG is feeded to VDR. A simple way to disable search timer updates is to use the SVDRP command SETS in your EPG update script:
svdrpsend plug epgsearch SETS off
<your EPG update script>
svdrpsend plug epgsearch SETS on
1.4.6 Timer conflict checking
Also have a look at epgsearch(4), section 'Working with the timer conflict menu'.
1.4.7 Email notification
Please make sure, that 'sendEmail.pl' is in the path of your executables and that the 'epgsearchupdmail.templ' and 'epgsearchconflmail.templ' exists in epgsearch's configurations directory!
- created a new timer - modified an existing timer - deleted a timer, that was void because of EPG changes or other user actions.
(Also requires 'Use search timers' in the search timer setup to be activated.)
(Also requires 'After each search timer update' or 'every ... minutes' in the conflict check setup to be activated.)
- sendEmail.pl: this is a simply script shipped with epgsearch, that allows mail delivery also on systems without a configured mail server. Please copy it to your $PATH - sendmail: requires a properly configured mail system
After the account setup, check if it works with 'Test'. If you are using 'sendEmail.pl' for mail delivery, there should be something like 'Email sent successfully' at the end of the test output. The test function is not available for method 'sendmail'.
Also have a look at epgsearch(4), section 'Email notifications'.
This is quite the same as VDRAdmin's auto-timers, but needs no external software. When you create a search, you can give it an option to use it as search timer. Now the plugin scans EPG entries in certain update intervals (->setup) in the background and creates timers if there are matching entries. If you don't like to get a new timer, but only want to be informed about the event set 'Announce only (no timer)' to yes. Since these search timers are quite useful for serials, you can set the option 'serial recording' in a search, which creates timers whose recordings are stored in a folder with the serials name and whose entries are named with the episode name. If there is no episode name, the plugin names the recording with a date/time string.
To use search timers, you also have to activate them in the plugins setup. Also edit the SVDRP port, if you are not using the default 2001.
If you want to trigger a background scan manually simply
touch /etc/vdr/plugins/epgsearch/.epgsearchupdate
This can also be part of your shutdown script. (Add here a sleep afterwards to give the plugin the time to finish the scan.)
For more info about searchtimers please refer to epgsearch(4), 'Description of the search process' and 'How do Search Timers work?'
This section explains the feature 'Avoid repeats' for a search timer. Sometimes one cannot avoid double recordings of an event only by setting the corresponding search criterions.
Therefore the feature 'avoid repeats' tries to check before creating a timer, if the same event was already recorded in the past or if there is a timer that records the same event. If so, there will be no new timer for the event.
To check if two events are the same there are many possible settings for a search timer. You can choose the title, subtitle, description or extended EPG categories within the description of an event to be compared with the elements of another event.
This comparison is always done case-sensitive and for the whole term. But the description of an event makes an exception of this. First all text within the description will be truncated that looks like an extended category entry, e.g. 'Rating: tip'. An extended category entry is a line of text beginning with max. 40 signs, followed by ':' and ending with max. 60 further signs. The reason for this cutting is that some categories like the rating of an event are not part of the description of the repeat of the same event.
The remaining text will now be compared by length. If the difference is bigger then 90%, then we rate the description of the two events as different. If not, we apply the Levinsthein-Distance-Algorithm (LD), which makes a fuzzy text comparison. We accept the description of the events as equal, if LD returns a match of more then 90%. Since LD is quite runtime intensive (O(mn)), you should not choose 'compare description' as the only comparison criterion, but combine it always with other criterions.
As already mentioned each search timer update checks search timers with this feature for recordings in the past or an already existing timer for the same event.
To remember past recordings epgsearch stores their info in the file epgsearchdone.data. You can have a look at the contents of this file calling 'show recordings done' in the 'actions' of the searches menu. This file only stores info about recordings that are complete, i.e. that started and stopped just in time. So a broken recording will not be stored in this file and epgsearch will automatically try to record the next repeat, if there is any.
How to use it?
As you see, the whole feature depends on the quality of the EPG. After creating such a search timer, you should first check if it does what is intended. Therefore the menu of search results has an additional mode for the key 'blue' named 'Timer preview'. Here you can see, what timers the next update would create. Existing timers are labeled with 'T', future timers with 'P'.
Hint: If the programming results in a conflict simply disable the conflicting timer in the timers menu. The next search timer update, will try to program a different timer for the same event, if it exists.
When it works not correctly :-)
To get a better control of the programming or not-programming of the timers when using this feature a log file was introduced. When starting epgsearch with the command line option '-v n' where n is the log level than you get additional info in the file epgsearch.log. Available log levels are 0 (no logging) to 3 (extended logging). See also the manual for the command line options.
See epgsearch(4).
Some EPG providers deliver additional EPG information like the type of event, the video and audio format, cast,... in the content summary.
Note: This is different from the content descriptors introduced in vdr-1.7.11, that are delivered as extra data with a common standard. Unfortunately not all providers deliver this data, or the set wrong descriptors. So you can use the approach of 'extended EPG info' here, which is a way to extract that info from the content summary.
Using tvm2vdr or epg4vdr you can import this into vdr. To use this information with search timers one has to configure it with the file epgsearchcats.conf in the epgsearch config directory. The format of the file is as follows:
ID|category name|name in menu|values separated by ','(option)|search mode(option) - 'ID' should be a unique positive integer (changing the id later on will force you to re-edit your search timers!) - 'category name' is the name as delivered by the EPG provider, e.g. 'Genre' - 'name in menu' is the name displayed in epgsearch. - 'values' is an optional list of possible values - 'search mode' specifies the search mode: text comparison: 0 - the whole term must appear as substring 1 - all single terms (delimiters are ',', ';', '|' or '~') must exist as substrings. This is the default search mode. 2 - at least one term (delimiters are ',', ';', '|' or '~') must exist as substring. 3 - matches exactly 4 - regular expression numerical comparison: 10 - less 11 - less or equal 12 - greater 13 - greater or equal 14 - equal 15 - not equal
Sample files for epgsearchcats.conf are delivered with the plugin in the directory 'conf'.
Simply copy the one that fits for you to the epgsearch configuration directory filename epgsearchcats.conf and then have a look to the search timers edit menu (after a restart of VDR).
Since setting up a new epgsearchcats.conf is a lot of work, I've added a small tool 'createcats', that makes the biggest part of the job. It should have been compiled with the plugin and exists in the sources directory.
See createcats(1) for information about how to use it.
Internals: epgsearch scans the summary of an event for the category name followed by ': ' for all categories that have a corresponding value set in the search timer. The search is case sensitive regarding the category name as also the value.
To use this plugin as a replacement for the default green key, simply put the line
Green @epgsearch
in your keymacros.conf. If you don't like to get another plugin entry in your main menu, first hide it by setup. Then you could use my launcher-plugin and put the line
Green @launcher x
in your keymacros.conf, where x is the position of the Epgsearch plugin within launchers menu listing.
Another approach is using a patch to VDR that replaces vdr's standard schedule menu with epgsearch (vdr-replace-schedulemenu.diff.gz in the patches subdir, thanks to the author Uwe/egal@vdrportal). When using this patch the entry should look like
Green Schedule
This patch is already included in some patch collections, like the Bigpatch.
epgsearch delivers 2 'mini'-plugins. Both require an installed epgsearch (but epgsearch can be hided in the main menu):
Have fun!
Christian Wieninger
See epgsearch(4) or read online
<http://winni.vdr-developer.org/epgsearch/README.DE>
<http://winni.vdr-developer.org/epgsearch/README>
<http://winni.vdr-developer.org/epgsearch/MANUAL>
"epgsearch.conf(5)", "epgsearchcats.conf(5)", "epgsearchcmds.conf(5)", "epgsearchdirs.conf(5)", "epgsearchmenu.conf(5)", "epgsearchuservars.conf(5)", "epgsearchdone.data(5)", "epgsearchswitchtimer.conf(5)", "epgsearchblacklists.conf(5)", "epgsearchchangrps.conf(5)"
epgsearch.conf
Searchtimers. See "epgsearch.conf(5)".
epgsearchcats.conf
Categories, advanced epg. See "epgsearchcats.conf(5)".
epgsearchcmds.conf
EPG-commands, like the commands in commands.conf. See "epgsearchcmds.conf(5)".
epgsearchdirs.conf
Pre-defined patches which can be selected while editing an searchtimer. See "epgsearchdirs.conf(5)".
epgsearchmenu.conf
Configuration of the OSD menu layout. See "epgsearchmenu.conf(5)".
epgsearchuservars.conf
User defined variables. See "epgsearchuservars.conf(5)".
epgsearchdone.data
The done-data. See "epgsearchdone.data(5)".
epgsearchswitchtimers.conf
The switchtimers. See "epgsearchswitchtimer.conf(5)".
epgsearchblacklists.conf
The blacklist. See "epgsearchblacklists.conf(5)".
epgsearchchangrps.conf
The channelgroups. See "epgsearchchangrps.conf(5)".
epgsearchtemplates.conf
Templates for searchtimers. See "epgsearchtemplates.conf(5)".
Mike Constabel <epgsearch (at) constabel (dot) net>
Bugreports (german):
<http://projects.vdr-developer.org/projects/plg-epgsearch>
Mailinglist:
<http://www.vdr-developer.org/mailman/listinfo/epgsearch>
Copyright (C) 2004-2010 Christian Wieninger
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
The author can be reached at cwieninger@gmx.de
The project's page is at http://winni.vdr-developer.org/epgsearch
The MD5 code is derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm.
2019-11-01 | perl v5.30.0 |