autoSyncPodder 0.2

autoSyncPodder is a software which automatically downloads podcasts and syncs them with your mp3/ogg player.
autoSyncPodder is a software which automatically downloads podcasts and syncs them with your mp3/ogg player – everything without user interaction. It is licensed under the GPL v2 or later.

I’ve have the software running on my media center server which is running 24/7. The download part of the autoSyncPodder is called by cron once a day (in the night). I own a mp3/ogg player (Trekstor Vibez) which works by just coping the files onto it, no rehashing needed. The syncing is started as soon as I plug the player into a USB port. If a file gets deleted on the player the file will get deleted at the next sync on the computer too. After a successful synchronization the software will generate a beep if the user it is running under has the permissions for it.

Requirements:

Python

Installation:

This installation has been tested on Debian and (K)ubuntu systems, but it should work on any Linux distribution.

At first extract the downloaded archive and copy the .autoSyncPodder directory to home directory of the user under whose account the software is running. (If the download and syncing are done by different users you need to make sure both find the config in their home directory (e.g. by symlinking). Check also the permissions in this case.) Copy the other directory to a place of your choosing, for this manual I assume /home/user/autoSyncPodder/

Edit the .autoSyncPodder/autoSyncPodder.ini configuration file to reflect your setup. Create and configure a sub directory on your player if you would like to have the podcast copied into a separated directory (recommended) and take a look at the .autoSyncPodder/feeds directory which contains the feeds the software will download and synchronize. You’ll find some example podcasts there.

Install the following software autoSyncPodder depends on : python-feedparser and ivman. On Debian and (K)Ubuntu following works:
apt-get install python-feedparser ivman

Now you can test if the downloading works by calling ~/autoSyncPodder/src/asp_download.py -i . The parameter tells autoSyncPodder to ask you for every download. Choose the ones you did not listen already for downloading.

After this part of the work is done we need to find out some unique hardware data of your player so the computer knows that it should sync this device. For this plug your player into a USB port and use following command:

udevinfo -a -p /block/sdb

Assuming that the player got assigned the device /dev/sdb, change the device name accordingly. You get a long list with ATTRS or SYSFS depending on your distribution and version. You need now to search for a section (DO NOT mix sections!) which contains enough data to identify the device (Tip: Start from the beginning of the output). You will find something like

ATTRS{product}=="vibez",
ATTRS{manufacturer}=="TrekStor"
ATTRS{serial}=="XXXXXXXXXXXX"

or
SYSFS{product}=="vibez"
SYSFS{manufacturer}=="TrekStor"
SYSFS{serial}=="XXXXXXXXXXXX"

Use this data to create a file /etc/udev/rules.d/20-autoSyncPodder.rules with following content:

# autoSyncPodder udev config
ATTRS{product}=="vibez", ATTRS{manufacturer}=="TrekStor", ATTRS{serial}=="XXXXXXXXXXXX", NAME="mp3player%n"

or

# autoSyncPodder udev config
SYSFS{product}=="vibez", SYSFS{manufacturer}=="TrekStor", SYSFS{serial}=="XXXXXXXXXXXX", NAME="mp3player%n"

Now udev knows when to create /dev/mp3player* devices and not sd* ones. Now we need to make sure everyone else is ignoring these devices (= no popup, no auto mounting) by adding following content to /etc/hal/fdi/policy/preferences.fdi after the line < deviceinfo version="0.2" >< /deviceinfo >

< !-- autoSyncPodder -- >
< device >
< match key="block.is_volume" bool="true" >
< match key="block.device" contains="/dev/mp3player" >
< merge key="storage.automount_enabled_hint" type="bool" >false< /merge >
< merge key="volume.ignore" type="bool" >true< /merge >
< /match >
< /match >
< /device >

Now every other daemon will ignore the player but we need to act on its connecting. We use ivman for this, which support 2 modes: user or system wide mode. In our chase the user mode is better, if you want to use the system wide one make sure the user ivman is using in this case has the correct permissions. If you call ivman as a user it will just fork, try that and kill it afterwards which should create a ~/.ivman directory. Open the ~/.ivman/IvmConfigActions.xml file and insert after

< !-- perform these rules on devices already attached when Ivman starts -- >
< ivm :Option name="checkOnInit" value="true" / >

following

< !-- try to mount any mountable volume at all -- >
< ivm:Match name="ivm.mountable" value="true" >
< ivm:Match name="hal.block.device" value="/dev/mp3player" >
< ivm:Option name="exec" value="/home/user/autoSyncPodder/src/asp_sync_ivman.sh > /tmp/asp.log 2 > /tmp/asp.err" / >
< /ivm:Match >
< /ivm:Match >

And open ~/.ivman/IvmConfigBase.xml and unset the user and group stuff and configure a pid file. It is also a good idea to active the debug output. Now you can start ivman again. Make sure that it is started after every reboot! Take a look at the /home/user/autoSyncPodder/src/asp_sync_ivman.sh file, maybe you need to change the charset for your player.

Now try it out. Remove the player and plug it in again. If it does not work take a look at the systems logs and the /tmp/asp.log and /tmp/asp.err file. You can also tell ivman to stay in the forground for easier debugging.
If everything works you may use cron to download your files,

crontab -e
# m h dom mon dow command
MAILTO=your@mail.address
13 6 * * * /home/user/autoSyncPodder/src/asp_download.py

last updated on:
February 5th, 2008, 10:44 GMT
price:
FREE!
developed by:
Robert Penz
homepage:
robert.penz.name
license type:
GPL (GNU General Public License) 
category:
ROOT \ Multimedia \ Audio

FREE!

In a hurry? Add it to your Download Basket!

user rating 12

3.3/5
 

0/5

Add your review!

SUBMIT