my first python script to organise recordings into folders/directories

I dont understand python so possibly is related but I doubt it as your symptoms suggest only a single tuner is working hence you can record one channel but are limited on the 2nd channel you wish to watch (suggests you can only watch programs broadcast on same transponder as the channel you are recording)

But my point is I have always been able to watch one whilst recoding another until after I put this script on hence my comment about coincidence
 
Im sure someone with better knowledge of python will be able to help you but in the mean time you could try moving two recordings of the same show to the default movie location to see IF the script is still running its default location & check after an hour to see if its working, everything else looks to be in order so possibly its the moving of the location that's causing you problems but I'm guessing & that's not the way to sort issues
 
Last edited:
For those of you having problems with this, if you have the ability to SSH in to your box, you can trouble shoot things much easier.

SSH in to the box using putty.
type

root@zgemmah2s:~# crontab -e

this will bring up the cron timers you have set and will let you edit them if there are any spelling mistakes.. much easier than using the remote control.. I would recommend setting it up using the gui and then editing it over SSH as then you will have the correct format.

You should see a line that is similar to this :

00 * * * * python /mnt/hdd/ordermovies.py

You can save and exit out of this file by pressing Escape, then typing :wq!

if you want to test if things are working, from the SSH prompt type :

root@zgemmah2s:~# python /mnt/hdd/ordermovies.py

obviously replace the path with the actual location.. This will show you any errors the script is throwing.. if you get no errors, then the script has run correctly.

Edit : If you are having problems getting the script on to your box in the first place, you can use the below commands :

root@zgemmah2s:~# wget https://goo.gl/opveNE
root@zgemmah2s:~# mv opveNE ordermovies.py

Edit 2: To start typing in crontab you will first need to press "i". this will put you in "insert mode".. once you are done, press escape to go back to "command mode".
 
Last edited:
Guys,

Tried everything and not able to get it to work (see screenshots below)

View attachment 17858View attachment 17859View attachment 17860


Any help much appreciated!

Cheers,

Ben

Ben,

Can I ask you to try with a series without an & in the name, the & could be causing a similar issue to what someone else had earlier with an appostrophy in the name, it should be being dealt with by the script but I may have missed something

I've had a couple of strange things happening that coincide with me setting this up (and note I say coincide, so may not be related but possibly is).
If we have been watching a channel either FTA or other and hit the record button for the channel we are watching, it starts to record as normal. However, when we then try to select another channel, it skips several of them and those in between will not work giving an error message. I have tried to screen print but it has gone from the screen before I get to the PC :(.

This first happened when the wife was "driving" so as usual my reaction was "what have you done!". However it has since happened to me (much to her delight).

Just tried again this morning but cannot get it to replicate the fault so thinking it may have to be part of a sequence of events that the box doesn't like.

This has happened on my H2S running wooshbuild. I have also put it on my 2S running sucmnsee so I will try that box later and see if it happens on that one.

The script doesn't effect anything to do with the signal nor the tuners and I would be very surprised if it has caused the issue. I did have a similar issue to you the other day which I believe was the result of two recordings being recorded at the same time, or overlapping at the end/start. I turned the box on too watch something and was only getting a few channels, rebooted the box, which impressed the wife as Eastenders was recording, and still nothing. When I then looked at my file list I noticed I had two recordings running so both tuners where being used. Once one had finished everything went back to normal

Okay so from the beginning this is what I done... please correct me if I'm wrong.

Edited the .py file to my correct path (/media/hdd/Recordings) & saved.
Ftp'd the .py file to home/media/hdd
Rebooted box
Menu > Timers > CronTimers > Add
Hourly - Custom - python /media/hdd/ordermovies.py & save.
Rebooted box & wait until the next hour is up.

Nothing :boo:

Any help much appreciated.

OK, when you edited the file and saved it did the Indents in script get removed? ie if all the lines are left justified it will stop the script from working, this is a python thing that if you are doing a loop, to loop through program names, for example, all of the code in the loop must be indented.
 
I completely removed it mate. Ftpd the .py file back over and still nothing. Can't think what else to try.

Set locations to default just in case it was my path messing things up.

Really want to bet this working :(

---------- Post Merged at 02:57 PM ----------

Ftpd a new copy of the .py file might I add.
 
Sorry tablet made it a capital c haha was lower case of putty. Not overly confident with ssh. I created with remote then edited the file via ftp.

Appreciate your help mate.

---------- Post Merged at 03:06 PM ----------

Just run the test says can't open files such file/folder found
 
Quote
The script doesn't effect anything to do with the signal nor the tuners and I would be very surprised if it has caused the issue. I did have a similar issue to you the other day which I believe was the result of two recordings being recorded at the same time, or overlapping at the end/start. I turned the box on too watch something and was only getting a few channels, rebooted the box, which impressed the wife as Eastenders was recording, and still nothing. When I then looked at my file list I noticed I had two recordings running so both tuners where being used. Once one had finished everything went back to normal

That did cross my mind, but as it had only happened since running the script I put 2 + 2 together and got, well obviously not 4 :willy nilly:
Still think it's a great idea so hope it works and thanks again for all your work on it.
 
Last edited:
check the path in the file.. if your recordings aren't in /mnt/hdd/movie then it's going to fail.

Yes all in order and it is working for me setting up directories which is great. Just had that weird issue on a couple of occasions but as grog68 says, it might have been recording 2 channels at the time we tried to select another.
 
Can I ask you to try with a series without an & in the name, the & could be causing a similar issue to what someone else had earlier with an appostrophy in the name, it should be being dealt with by the script but I may have missed something

I've just created two files with the & sign in the name and ran the script and it worked fine so the & isn't the issue.

I am still looking into this for you
 
OK have made a few more little changes and the file download url has changed :

1. The script now has a config file called omconfig.py and this is the file you can set options, only two at the moment. This reduces the chance of indents in the main script getting deleted when changing settings and stopping the script from working

2. Added the option for recorded programs that are marked as New: in planner to be stored in the same folder as the recordings of the same program that are not marked as New:

Download the zip file from https://www.dropbox.com/s/inbxuto9yaj0wmh/ordermovies.zip?dl=1

unzip the file on your computer
open the omconfig.py file in a unix friendly text editor notepad should be OK I believe. In this file you will be able to set two variables:

mergenew : set to 0 if you want recordings marked in the planner as NEW: kept separate, set to 1 if you want them stored in the same folder as other recordings of the same program that are not marked as NEW:

path : set this to the path where your recordings are stored.

Save the file and FTP the two py files to your server. If you have used an older version of the script then you can just overwrite the old version with this version. Both files MUST be in the same folder as each other. I have them stored in /home/root but I know others have ftp'ed the script elsewhere.

If you have used older version of the script and have put the new version in the same location then you do not need to do the next step.

Now on your box go to the cron manager menu -> Timers -> CronTimers
Press the Add (green) button and then set the cron up as below:


Run how often? : Hourly
Command type : Custom
Cammand to run : python /home/root/ordermovies.py (make sure this points to the correct path where you uploaded it to)


Then click on the save button (green)


Make sure your cron manager is running and autostart is active


Your recording will initially be recorded in the normal location, the script will now run once an hour and move recordings as explained in my first post.


When you look at file list you will see folders, click on the relevant folder and you should then see a list of your recordings of that show, to return to the first list click on the folder at the top '..' .


All feedback welcome and appreciated in this thread
 
Last edited:
Hopefully this version fixes my issue. Will it work for programs already recorded in my file list or just new recordings? Cheers for all your hard work mate.

Sent from my SM-G920F using Tapatalk
 
Google URL Shortener
https://goo.gl/jADBqK – this goo.gl shortlink has been disabled. It was found to be violating our Terms of Service. Click here and here for more information about our terms and policies respectively.

Sent from my SM-G920F using Tapatalk
 
Getting a problem with the link:

View attachment 17863

Google URL Shortener
https://goo.gl/jADBqK – this goo.gl shortlink has been disabled. It was found to be violating our Terms of Service. Click here and here for more information about our terms and policies respectively.

Sent from my SM-G920F using Tapatalk

Thanks for the heads up, it appears google don't allow you to use their service for links to zip files. I have updated my post above and put the drop box link in.

Download from https://www.dropbox.com/s/inbxuto9yaj0wmh/ordermovies.zip?dl=1
 
Back
Top