alexhartm / tonie-podcast-sync Goto Github PK
View Code? Open in Web Editor NEWallows synching podcast episodes to Toniebox creative tonies
Home Page: https://pypi.org/project/tonie-podcast-sync/
License: MIT License
allows synching podcast episodes to Toniebox creative tonies
Home Page: https://pypi.org/project/tonie-podcast-sync/
License: MIT License
Hi,
thank you for your great work.
currently i am synching the Sandmänchen Podcast and the feed is not sorted by date but rather grouped in weekdays:
https://www.antennebrandenburg.de/programm/hoeren/podcasts/Zappelduster_Podcast/podcast.xml/feed=podcast.xml
so I only get the "monday" episodes.
could the episodes be orderd by date?
Another idea is if it would be possible to add a "raondom order" parameter for selecting episodes.
that could be very useful for stale podcast that has many episodes.
Kind Regards Stefan
Hey, awesome project, it works like charm!
Sorry for opening an issue, it is more of a question:
Do you know if it is possible to adjust the volume? To me the tracks seem quieter than a normal Tonie.
Synchronising command and Podcast import are not working.
Hi there, thank you for the Great work.
If I take the example file and run it with my credentials two errors appear. The Podcast sorting function and the syncing function are not working properly. Is this a common issue?
I tried running the example script and ran into an error:
OSError: [Errno 22] Invalid argument: 'podcasts\\Gute Nacht mit der Maus\\Sun, 14 Jan 2024 16:00:35 GMT Unter Wasser.mp3'
The whole trace is pasted below.
I could fix the problem by deleting f"{ep.title}.mp3"
in __generate_filename
.
I am running python 3.12.1 with toniepodcastsync 2.0.2
error stack trace:
--------------------------------------------------------------------------
OSError Traceback (most recent call last)
Cell In[5], line 3
1 # Fetch new podcast episodes and copy them to greenTonie.
2 # The tonie will be filled with as much episodes as fit (90 min max).
----> 3 tps.sync_podcast_to_tonie(maus, Purple)
5 # Kid's should fall asleep, so let's limit the podcast
6 # episodes on this tonie to 60 minutes in total.
7 # Use the optional parameter for this:
8 #tps.sync_podcast_to_tonie(maus, orangeTonie, 60)
File [c:\Users\wr3636\Anaconda3\envs\tonie\Lib\site-packages\toniepodcastsync.py:97](file:///C:/Users/wr3636/Anaconda3/envs/tonie/Lib/site-packages/toniepodcastsync.py:97), in ToniePodcastSync.sync_podcast_to_tonie(self, podcast, tonie_id, max_minutes)
95 # add new episodes to tonie
96 self.__wipe_tonie(tonie_id)
---> 97 cached_episodes = self.__cache_podcast_episodes(podcast, max_minutes)
99 for e in track(
100 cached_episodes,
101 description=(
(...)
107 refresh_per_second=2,
108 ):
109 self.__upload_episode(e, tonie_id)
File [c:\Users\wr3636\Anaconda3\envs\tonie\Lib\site-packages\toniepodcastsync.py:147](file:///C:/Users/wr3636/Anaconda3/envs/tonie/Lib/site-packages/toniepodcastsync.py:147), in ToniePodcastSync.__cache_podcast_episodes(self, podcast, max_minutes)
138 ep_list: list[Episode] = []
140 for ep in track(
141 episodes_to_cache,
142 description=f"{podcast.title}: Cache episodes ...",
(...)
145 refresh_per_second=2,
146 ):
--> 147 if self.__cache_episode(ep):
148 ep_list.append(ep) # noqa: PERF401: need a regular loop for progress
150 log.info(
151 "%s: providing all %s episodes with %d.1 min total",
152 podcast.title,
153 len(episodes_to_cache),
154 (total_seconds / 60),
155 )
File [c:\Users\wr3636\Anaconda3\envs\tonie\Lib\site-packages\toniepodcastsync.py:172](file:///C:/Users/wr3636/Anaconda3/envs/tonie/Lib/site-packages/toniepodcastsync.py:172), in ToniePodcastSync.__cache_episode(self, ep)
170 r = requests.get(ep.url, timeout=180)
171 if r.ok:
--> 172 with fname.open("wb") as _fs:
173 _fs.write(r.content)
174 ep.fpath = fname
File [c:\Users\wr3636\Anaconda3\envs\tonie\Lib\pathlib.py:1014](file:///C:/Users/wr3636/Anaconda3/envs/tonie/Lib/pathlib.py:1014), in Path.open(self, mode, buffering, encoding, errors, newline)
1012 if "b" not in mode:
1013 encoding = io.text_encoding(encoding)
-> 1014 return io.open(self, mode, buffering, encoding, errors, newline)
OSError: [Errno 22] Invalid argument: 'podcasts\\Gute Nacht mit der Maus\\Sun, 14 Jan 2024 16:00:35 GMT Unter Wasser.mp3'`
Hi,
I tried the example urls from the readme and they worked great.
However when I try another podcast url: https://pcr.apple.com/id1703018128 (which forwards to https://anchor.fm/s/e74eb474/podcast/rss) the upload to the tonie is not working.
No error pops up and the output is "Successfully uploaded [Episode(podcast='Märchenwelten - Wunderschöne Märchen & ....", but nothing uploads to the tonie cloud.
During runtime the necessary mp3 files are correctly downloaded to the podcast folder (and removed at the end).
Please let me know if you have time to check this out. Otherwise I might take a look at the code myself and try to ,make it work.
Best regrads
Slutskov
Hi, first thanks for sharing your repo. I found that lxml package required for parsing the podcast xml is missing and should be added to the pip dependencies.
Tested on a fresh ubuntu today. Enabling logging showed me the error like shown here:
Have a nice day!
k3mpaxl
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.