amsehili / genrss Goto Github PK
View Code? Open in Web Editor NEWgenRSS generates an RSS 2.0 feed from media files in a directory
Home Page: https://github.com/amsehili/genRSS
License: MIT License
genRSS generates an RSS 2.0 feed from media files in a directory
Home Page: https://github.com/amsehili/genRSS
License: MIT License
Is it possible to add the following iTunes tags:
- <itunes:duration>300</itunes:duration>
- <itunes:title>The Example Times Daily News Briefing</itunes:title>
- <itunes:block>yes</itunes:block>
And copyright tags: <copyright>Copyright 2018 The Example Times – For Personal Use Only</copyright>
Everything about this script is great. I'm hoping to generate an RSS feed for Google that requires the following:
https://developers.google.com/news/assistant/newsbriefings/technical-requirements
Any help would be greatly appreciated.
I am running the program directly as listed in the instructions, and I only get the error "can't concat str to bytes." I this for Python 2?
The current directory structure of this project is:
.
├── LICENSE
├── pyproject.toml
├── README.md
├── setup.py
├── src
│ ├── genRSS.py
│ └── util.py
└── test
└── ...
When installing the package, this will happen:
venv/lib/python3.11/site-packages
├── eyed3/
├── filetype/
├── mutagen/
├── ...
├── genRSS.py
└── util.py
Both the genRSS.py
and the util.py
will be installed at the root of the python modules. This means it is possible to import util
from anywhere:
$ ipython
In [1]: import util
In [2]: # ↑ That should have failed!
You can also check this behavior by inspecting the contents of the wheel file available from PyPI:
$ wget https://.../generss-0.3.0-py3-none-any.whl
$ unzip -l generss-0.3.0-py3-none-any.whl INT ✘
Archive: generss-0.3.0-py3-none-any.whl
Length Date Time Name
--------- ---------- ----- ----
10167 2023-09-13 21:15 genRSS.py
19457 2023-09-13 19:33 util.py
1074 2023-09-13 21:16 generss-0.3.0.dist-info/LICENSE
3780 2023-09-13 21:16 generss-0.3.0.dist-info/METADATA
92 2023-09-13 21:16 generss-0.3.0.dist-info/WHEEL
39 2023-09-13 21:16 generss-0.3.0.dist-info/entry_points.txt
12 2023-09-13 21:16 generss-0.3.0.dist-info/top_level.txt
613 2023-09-13 21:16 generss-0.3.0.dist-info/RECORD
--------- -------
35234 8 files
That's not good.
I expected this structure:
venv/lib/python3.11/site-packages
├── ...
└── genRSS/
├── __main__.py
└── util.py
Which means we have to move some files around the repository:
src/genRSS.py
→ src/genRSS/__main__.py
src/util.py
→ src/genRSS/util.py
And also setup Entry Points inside pyproject.toml
.
See also:
We have this in pyproject.toml
:
dependencies = ["mutagen==1.47.0", "eyed3==0.9.7"]
Why hard-coding the versions? Can't we just specify the minimum version instead? Or just leave out the version number, letting it auto-update the dependencies?
setup.py
is only needed for legacy build systems or legacy versions. It shouldn't be needed or used anymore. I suggest deleting it.
Using it like:
genRSS.py -C -r -d /mydir
I get items in the feed with date which are not the creation date (not sure where they are from), I guess they are just corrupted during a transformation.
Hello,
it´s possible for you to add / change the pubdate to the filedate ?
I have a big podcast collection an it will be a big help if they sorted by the real date.
many thanks ;)
Right now, if I run it with something like:
genRSS -d /a/long/path/to/my/directory/
I get items like:
<item>
<guid>http://localhost:8080//a/long/path/to/my/directory/file1.mp3</guid>
<link>http://localhost:8080//a/long/path/to/my/directory/file1.mp3</link>
<title>file1</title>
<description>file1</description>
<pubDate>Fri, 29 Mar 2024 22:45:08 +0000</pubDate>
<enclosure url="http://localhost:8080//a/long/path/to/my/directory/file1.mp3" type="audio/mpeg" length="79127804"/>
<itunes:duration>3955</itunes:duration>
</item>
This is as it says on the tin but if I want to use a different path to publish this, I now need to find/replace all "/a/long/path/to/my/directory/" to the desired actual path.
Being able to specify the leading path would be helpful.
Hallo,
I want to create an rss feed from a folder called
/storage/folder/artist
When I use genrss with -d I get an rss file with the wrong link in it:
"http://hostname//storage/folder/artist"
You can see // after the hostname and this can't work.
If I now try it as you describe, without the pending /?
-d storage/folder/artist
I get this (I mean correct) error: " --dirname must be a path to an existing directory.
I hope you understand my problem ;)
hello and thanks for the fantastic script.
my litte problem is proberly only a usage fault.
when i generate a rss the -t / --title parameter work in the
"
<title>xxxx</title>" field
but under
is there a easy solution for this problem ?
thanks
I made the tiny change of adding or "image" in fileMimeType
on line 411 and now images are automatically displayed by my feed reader.
Are there particular reasons to not simply make mutagen a requirement instead of optional?
Mutagen is cross platform and has no dependencies outide of the python standard library. Guaranteeing it's available would simplify setup process as well as the Readme doc. The change is very straightforward:
diff --git a/pyproject.toml b/pyproject.toml
index f2b7a5e..bb6caf1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,5 +5,7 @@ requires = ["setuptools", "wheel"]
name = "genRSS"
version = "0.2.0"
+dependencies = ["mutagen"]
+
[project.scripts]
genRSS = "genRSS:main"
This piggybacks off Issue #15. I'm using the script to extract the metadata as the title, but can it also extract the mp3's artist metadata and use it as the description? So when the feed is read, the title is the title of the track and the description is the artist.
This could give richer descriptions and dates than the filesystem.
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.