Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Idea: Pause download package when video is playing.
31st Jan, 2013, 10:46 PM
Post: #1
Trinket Offline
Registered
Posts: 40
Joined: Jan 2013
Reputation: 9
Information Pause download package when video is playing.
Hi! I'm new to the forum altough i have been reading it for quite a while.
I have been working the last days in a script that detects when XBMC starts playing stuff and uses the signal SIGSTOP to pause all proceses related to downloads and then, when the video stops playing, it uses the signal SIGCONT to resume them.
I have created the following folder ~/.xbmc/addons/script.service.procmanager where I store my script with the addon.xml file, the script is as follows:
http://pastebin.com/VmkqecST

I had to call the startall.py and stopall.py with sudo rights because the downloads are managed by other users and xbian user dosen't have the rights to manage them (I added those files with visudo so that i don't need a password to execute them with sudo).
The startall.py and stopall.py are as follows:
http://pastebin.com/aSJnS0Tx

What I did to get the PID of each process related to downloads, is to add each user that started that kind of process to a common group "download" so, for example, sabnzbd is executed by user sabnzbd which is a member of the group download, same for transmission, couchpotato and sickbeard, they all belong to the group download. I just get the process list of that group of users and then i send a sigstop to each process.

The problem with this script is that i can't manage to autostart it within xbmc, my addon.xml looks as follows
http://pastebin.com/H5Tp2hRm
I'm new to python so I'm not sure if what I've done is right, the default.py script is a copy paste of things I found around internet.
According to what I've read, the addon.xml will tell XBMC which script to start and when, but it dosen't seem to work. I found information regarding a workaround involving autoexec.py file, which I couldn't find.

I would really appreciate some help here as I don't know how to continue or how to debug this process.
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Messages In This Thread
Pause download package when video is playing. - Trinket - 31st Jan, 2013 10:46 PM
RE: Pause download package when video is playing. - belese - 1st Feb, 2013, 06:31 PM
RE: Pause download package when video is playing. - Trinket - 2nd Feb, 2013, 01:12 AM
RE: Pause download package when video is playing. - belese - 2nd Feb, 2013, 02:07 AM
RE: Pause download package when video is playing. - Trinket - 2nd Feb, 2013, 11:47 AM
RE: Pause download package when video is playing. - Trinket - 3rd Feb, 2013, 10:40 AM
RE: Pause download package when video is playing. - belese - 3rd Feb, 2013, 07:44 PM
RE: Pause download package when video is playing. - BartOtten - 4th Feb, 2013, 04:31 AM
RE: Pause download package when video is playing. - Trinket - 4th Feb, 2013, 04:40 AM
RE: Pause download package when video is playing. - belese - 4th Feb, 2013, 06:31 AM
RE: Pause download package when video is playing. - Trinket - 4th Feb, 2013, 09:19 AM
RE: Pause download package when video is playing. - belese - 4th Feb, 2013, 09:46 PM
RE: Pause download package when video is playing. - BartOtten - 5th Feb, 2013, 11:28 AM
RE: Pause download package when video is playing. - belese - 5th Feb, 2013, 09:24 PM
RE: Pause download package when video is playing. - Trinket - 6th Feb, 2013, 05:48 AM
RE: Pause download package when video is playing. - SolGarlic - 3rd Mar, 2013, 12:52 AM
RE: Pause download package when video is playing. - adepssimius - 8th Feb, 2013, 02:26 AM
RE: Pause download package when video is playing. - Trinket - 3rd Mar, 2013, 06:26 AM
RE: Pause download package when video is playing. - SolGarlic - 3rd Mar, 2013, 07:23 AM
RE: Pause download package when video is playing. - CurlyMo - 3rd Mar, 2013, 07:29 AM
RE: Pause download package when video is playing. - Trinket - 3rd Mar, 2013, 08:12 PM
RE: Pause download package when video is playing. - SolGarlic - 3rd Mar, 2013, 08:23 PM
RE: Pause download package when video is playing. - Trinket - 4th Mar, 2013, 04:43 AM
RE: Pause download package when video is playing. - SolGarlic - 4th Mar, 2013, 07:32 AM
RE: Pause download package when video is playing. - Trinket - 4th Mar, 2013, 07:51 AM
RE: Pause download package when video is playing. - SolGarlic - 4th Mar, 2013, 10:14 AM
RE: Pause download package when video is playing. - Trinket - 4th Mar, 2013, 10:23 AM
Re: Pause download package when video is playing. - min - 19th Mar, 2013, 04:09 AM
RE: Pause download package when video is playing. - Trinket - 20th Mar, 2013, 06:11 AM
Re: Pause download package when video is playing. - min - 21st Mar, 2013, 02:03 AM
RE: Pause download package when video is playing. - Trinket - 21st Mar, 2013, 08:59 AM
RE: Pause download package when video is playing. - gizag - 25th Mar, 2013, 07:58 PM
RE: Pause download package when video is playing. - CurlyMo - 25th Mar, 2013, 08:19 PM
RE: Pause download package when video is playing. - Trinket - 25th Mar, 2013, 10:22 PM
RE: Pause download package when video is playing. - gizag - 25th Mar, 2013, 10:43 PM
RE: Pause download package when video is playing. - zilexa - 26th Mar, 2013, 08:01 AM
RE: Pause download package when video is playing. - CurlyMo - 26th Mar, 2013, 08:10 AM
RE: Pause download package when video is playing. - cjvanzwol - 5th Oct, 2013, 08:35 PM
RE: Pause download package when video is playing. - Trinket - 5th Oct, 2013, 09:14 PM
RE: Pause download package when video is playing. - cjvanzwol - 6th Oct, 2013, 01:49 AM
RE: Pause download package when video is playing. - adepssimius - 6th Oct, 2013, 04:55 AM
RE: Pause download package when video is playing. - cjvanzwol - 7th Oct, 2013, 07:46 AM
RE: Pause download package when video is playing. - Trinket - 8th Oct, 2013, 09:27 PM

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 24th May, 2025, 05:37 PM Powered By MyBB, © 2002-2025 MyBB Group.