PDA

View Full Version : [ABM-MISC] Providers Download Script



pembo
03-06-16, 21:41
For those interested, attached is a shell script to download, check and copy the provider files for 28.2 and UK terrestrial on demand.

It downloads the following providers from GitHub

SKY UK
SKY IRL
Freesat
Terrestrial

to the /tmp location, then checks that there is a <provider> in the file, and after copies it to the right location and cleans up.

Please use this with care and only if you are confident with Linux shell scripts/etc.

It's pretty straight forward to add other providers for those who need them!

dsayers
03-06-16, 21:51
Will this automatically update them in the future or will we need to run the script every time there's an update?

pembo
03-06-16, 21:57
You'll need to run the script, though you could schedule it through cron if you so wished.

^^COMPASS^^
03-06-16, 22:32
pembo thanks for the Providers Download Script

However i am having a little trouble i have attached some pics & a log file

I do use other Linux shell scripts without issues

i transferred your updateProviders.sh to usr/script chmod to 755

run the script from VIX scripts

Any help would be appreciated.

pembo
03-06-16, 22:36
I'm taking a look - it runs fine from a telnet/ssh session but not from the vix script runner.
wget which does the download is getting it's connection reset.

pembo
03-06-16, 22:39
its to do with HTTPs - let me see what I can do!

abu baniaz
04-06-16, 00:39
The following method works at the moment:
1. Extract/unrar/unzip/inflate
2. Transfer to /tmp directory **
3. Chmod 755, (right click change file properties/attributes to 755)
4. Enter following command


cd /tmp && ./updateProviders.sh



** you can use the usr/script directory if you want. Change the command to reflect altered path.

Huevos
10-06-16, 18:55
How about just adding to the ABM menu?

Files go in:
/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker

Updates the providers files of active providers.

[deleted attachment]

dsayers
10-06-16, 19:26
How about just adding to the ABM menu?

Files go in:
/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker

Updates the providers files of active providers.

That's a great idea I can look at creating a plugin for it if it's possible

abu baniaz
10-06-16, 19:31
That's a great idea I can look at creating a plugin for it if it's possible
No need, it will be part of ABM.

Huevos
10-06-16, 21:03
Slight update.

Files go in:
/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker

[removed attachment]

Huevos
11-06-16, 14:18
Fix some network issues and gives a summary at the end.

Files go in:
/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoBouquetsMaker

[Edit:] Removed attachment as has now been committed and will be in next build. For latest version see Github:
https://github.com/oe-alliance/AutoBouquetsMaker/tree/master/AutoBouquetsMaker/src

lincsat
23-06-16, 23:15
Can it be modded to update custom files as well when they are available.

dsayers
24-06-16, 19:53
yes but it looks hard to modify all the code ive done a stand alone plugin to do it.

Huevos
24-06-16, 23:32
There are 3 provides with static CustomLCN files. None have changed since their creation.

dsayers
25-06-16, 20:51
There are 3 provides with static CustomLCN files. None have changed since their creation.

i think he was referring to the same way i wanted to do it add your own dbox link to update the custom.xml files i Evan forked github and changed the directory to custom but that wouldn't work

Huevos
25-06-16, 22:12
i Evan forked github and changed the directory to custom but that wouldn't workNot sure what you are talking about. :confused:

dsayers
25-06-16, 22:39
i edited the updateproviders.py like this to download the custom file from my own github


self.timerlength = 100 socket_timeout = 10
socket.setdefaulttimeout(socket_timeout)
self.index = 0
self.messages = []
self.version_checked = False
self.pluginGit = "https://github.com/davesayers2014/AutoBouquetsMaker"
self.gitProvidersFolder = "/raw/master/AutoBouquetsMaker/custom"
self.remoteVersion = "/raw/master/AutoBouquetsMaker/src/version.py"
self.providersFolder = "%s/custom/" % os.path.dirname(sys.modules[__name__].__file__)

Huevos
25-06-16, 23:58
How is that ever going to work... it is not a provider file.

dsayers
26-06-16, 00:29
i thought i could modify it thats why i started the other thread. iv manged to create a plugin to download it
same as lincsat has

Huevos
26-06-16, 11:28
Obviously you could modify it but I can't see what the point is if it is just for personal use. Sending the file to github is as much trouble as just FTPing it to the box. With the providers files it is different. It means once there is an update on github 1000's of users have access to that change immediately.

dsayers
26-06-16, 11:36
Obviously you could modify it but I can't see what the point is if it is just for personal use. Sending the file to github is as much trouble as just FTPing it to the box. With the providers files it is different. It means once there is an update on github 1000's of users have access to that change immediately.

thanks as said i share my image plus the custom file ive done a plugin here post 7 http://www.world-of-satellite.com/showthread.php?52065-how-to-add-my&goto=newpost i may start a new thread with the plugin once ive created an ipk for it for others to use

abu baniaz
24-07-16, 12:21
Is it possible to automate the update provider file or maybe update before running?

Huevos
24-07-16, 23:01
Yes, it is possible. Remove the menu item. Add a yes/no option in the config menu to run it prior to running the plugin.

I did consider this in the first place but didn't do it because the extra run time. What are other people's views on this?

dsayers
24-07-16, 23:06
The extra time isn't that much of a different plus it will stop people asking were channels are there would be no need to tell them to run the config updater all they would need to do is scan abm

judge
24-07-16, 23:56
Yes, it is possible. Remove the menu item. Add a yes/no option in the config menu to run it prior to running the plugin.

I did consider this in the first place but didn't do it because the extra run time. What are other people's views on this?

How would it work on automated scans?
As ABM doesn't require network access (except for this step), would need a disable option for boxes with only s/t/c feed connected...

dsayers
25-07-16, 00:07
You could probably have the option in configuration like when selecting including non indexed channels

abu baniaz
25-07-16, 00:10
How would it work on automated scans?
As ABM doesn't require network access (except for this step), would need a disable option for boxes with only s/t/c feed connected...

If feature is enabled, try download, if it has not network access, continue with existing file. Presumably people who run receiver with no internet connection will not enable a feature that requires internet access.

Or perhaps the update can itself be a schedule? Shame a bash script does not work, otherwise it could have been easily achievable with a cron job.

Huevos
25-07-16, 01:56
How would it work on automated scans?Whether the scan is automated or not is irrelevant. The update would be part of the scan.

As ABM doesn't require network access (except for this step), would need a disable option for boxes with only s/t/c feed connected...The update script already handles that situation. Try unplugging your network cable and you will see.

dsayers
19-09-16, 18:44
Or perhaps the update can itself be a schedule? Shame a bash script does not work, otherwise it could have been easily achievable with a cron job.

It can be done with a cron job ive updated wget and edited the script to download my custom.xml using wget --no-check-certificate "https://blah" -O yourfile it's still not finished as I need to remove the other provider options and tell it to move to custom https://www.dropbox.com/s/emj01ztlpvgu1k1/updateProviders.sh?dl=0 currently it downloads to tmp but won't move it to the custom folder im at work so I'll have another play over the weekend

dsayers
19-09-16, 18:45
The next question is is it bad to update the wget file?

dsayers
20-09-16, 07:13
Ok this is the final version and it works can someone test it without updating wget. Ftp updateproviders.sh to usr/script create the script folder if you haven't got one then run it via scriptrunner

File here
https://www.dropbox.com/s/9hkwrnvjkjrwyhr/updateProviders.sh?dl=0

It should download the following providers from GitHub
SKY UK
SKY IRL
Freesat
Terrestrial

If not you will have to ssh


opkg install wget

You may need to run


opkg update

Before install wget

Once done you can run this through a crontimer daily or weekly.

Big thanks to pembo for providing the original script

Ive also got it working correctly for my custom.xml

birdman
20-09-16, 10:39
Ok this is the final version and it works can someone test it without updating wget.
The wget commands work for me (on 4.2.005). The busybox wget just ignores the "--no-check-certificate" flag (it ignores certificates anyway).

You can simplify (shorten) the script if you don't need the differing colours per download (this is for a cron script - why would you need it?) by putting the downloads into a loop.

50488

dsayers
20-09-16, 15:34
Thanks I'll just need to add the cables.xml files.

birtdman did you definitely run it via scriptrunner? the original code worked via talnet but not scriptrunner

birdman
20-09-16, 18:42
Thanks I'll just need to add the cables.xml files.

birtdman did you definitely run it via scriptrunner? the original code worked via talnet but not scriptrunnerNo - I just ran it from the command line.
How would I run it via scriptrunner? (Happy to test it and debug any issues...).

dsayers
20-09-16, 18:46
Ftp to usr/script run it via vix script runner I'm trying to eliminate the use of talnet but as you can see on post 4 the original script wouldn't run via scriptrunner if its the wget file could it be updated on future images?

Ive updated wget when testing other scripts so im unsure if it would be needed using this script

Sent from my SM-G925F using Tapatalk

birdman
20-09-16, 19:52
...but as you can see on post 4 the original script wouldn't run via scriptrunner if its the wget file could it be updated on future images?wget is actually part of busybox (which is a single executable to handle many commands for small systems). So no, it won't be updated.
However, if it's not working the thing to do is to fix whatever it is that prevents it working.

The script works from the command line.
It works when run in the background with no terminal attached.

PS: There's a bug in the script I posted above. I tided up "too much".

And I can tell you what the problem is when running it through enigma2.
The enigma2.sh start-up script sets LD_PRELOAD to point at a library that ensures that the close-on-exec bit gets set for all opened file-descriptors (this is so that all sub-processes start without all of the files opened by enigma2).
If I set this to run the script I get what you saw:
root@mbtwin:~# LD_PRELOAD=/usr/lib/libopen.so.0.0.0 ./updateProviders.sh
Fetching sat_282_sky_uk
wget: error getting response: Connection reset by peer
grep: /tmp/upPv.tmp: No such file or directory
sat_282_sky_uk.xml - Not Installed: not a provider file
Fetching sat_282_freesat
wget: error getting response: Connection reset by peer
grep: /tmp/upPv.tmp: No such file or directory
sat_282_freesat.xml - Not Installed: not a provider file
Fetching sat_282_sky_irl
wget: error getting response: Connection reset by peer
grep: /tmp/upPv.tmp: No such file or directory
sat_282_sky_irl.xml - Not Installed: not a provider file
Fetching terrestrial_uk_freeview
wget: error getting response: Connection reset by peer
grep: /tmp/upPv.tmp: No such file or directory
terrestrial_uk_freeview.xml - Not Installed: not a provider file
Completed - Elapsed time: 6 secsFor some reason this affects wget.
The simple solution is to unset it at the start of the script.

Here's a version with that in, and the "too much tidying" bug fixed too.

50489

dsayers
21-09-16, 07:27
Thanks I've tweaked it for my custommix.xml


https://www.dropbox.com/s/tq7ngkrl5nzeisz/updatecustom.sh?dl=0

birdman
21-09-16, 10:31
Thanks I've tweaked it for my custommix.xml


https://www.dropbox.com/s/tq7ngkrl5nzeisz/updatecustom.sh?dl=0Except that now has a loop with only one value - so you don't need the loop.