Coder Social home page Coder Social logo

podfox's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

podfox's Issues

IndexError: list index out of range

The result of podfox feeds, I did nothing but just adding a feed after installing podfox and configuring the json file.

$ podfox feeds                                                                                                                                                                                                 
title                                         |  shortname
================================================================================
Traceback (most recent call last):
  File "/home/chz/anaconda3/envs/podfox/bin/podfox", line 8, in <module>
    sys.exit(main())
  File "/home/chz/anaconda3/envs/podfox/lib/python3.8/site-packages/podfox/__init__.py", line 303, in main
    pretty_print_feeds(available_feeds())
  File "/home/chz/anaconda3/envs/podfox/lib/python3.8/site-packages/podfox/__init__.py", line 268, in pretty_print_feeds
    dl = '' if feed['episodes'][0]['downloaded'] else '*'
IndexError: list index out of rang

UPDATE:

It turns out, podfix failed to parse the feed link. the feed.json file in my shortname directory is only a few lines.

I tried the feed link in your README, it works OK, so why podfox failed to pasrse my feed link(https://aezfm.meldingcloud.com/rss/program/11)?

Dependencies upgrade

Any plans for an upgrade to support feedparser > 5.2.1 ?

Collecting feedparser Downloading feedparser-6.0.2-py3-none-any.whl (80 kB) |████████████████████████████████| 80 kB 2.9 MB/s Collecting sgmllib3k Downloading sgmllib3k-1.0.0.tar.gz (5.8 kB) Using legacy setup.py install for sgmllib3k, since package 'wheel' is not installed. ERROR: podfox 0.1.2 has requirement feedparser==5.2.1, but you'll have feedparser 6.0.2 which is incompatible. Installing collected packages: sgmllib3k, feedparser Running setup.py install for sgmllib3k ... done Attempting uninstall: feedparser Found existing installation: feedparser 5.2.1 Uninstalling feedparser-5.2.1: Successfully uninstalled feedparser-5.2.1 Successfully installed feedparser-6.0.2 sgmllib3k-1.0.0

Feedparser 5.2.1 have issues with python3.9

Traceback (most recent call last): File "/home/x/podfox_env/bin/podfox", line 5, in <module> from podfox.__init__ import main File "/home/x/podfox_env/lib/python3.9/site-packages/podfox/__init__.py", line 25, in <module> import feedparser File "/home/x/podfox_env/lib/python3.9/site-packages/feedparser.py", line 93, in <module> _base64decode = getattr(base64, 'decodebytes', base64.decodestring) AttributeError: module 'base64' has no attribute 'decodestring'

parallel downloads

Podcasts should be downloaded concurrently, so that slow servers do not slow the downloading down.

installation error

I have an Asustor NAS, model AS1002T, kind of old. Last week Python was updated to version 3.10.6r10 and, for some unknown reason, all the packages that were installed are gone. Among them, Podfox. I managed to reinstall almost all of them, but Podfox gives the following error:

pip3 install podfox
Collecting podfox
Using cached podfox-0.1.2-py3-none-any.whl (5.8 kB)
Collecting colorama==0.3.7
Using cached colorama-0.3.7-py2.py3-none-any.whl (19 kB)
Collecting feedparser==5.2.1
Using cached feedparser-5.2.1.zip (1.2 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in feedparser setup command: use_2to3 is invalid.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

How can I resolve this issue and install Podfox again?

ps: If Podfox is installed, will it recognize the Podcasts already collected and configured in the previous installation?

base64.decodestring is depricated in Python 3.1 and is removed in 3.9

After installing I received this error from line 93 in feedparser.py:

_base64decode = getattr(base64, 'decodebytes', base64.decodestring) AttributeError: module 'base64' has no attribute 'decodestring'

I can't seem to create a new pull request, or I would just push my changes... Very easy fix: just change the end of line 94 to read base64.decodebytes and everything runs like a dream.

Thanks for writing this! It's very awesome. :)

A lot episodes are not parsed

I tried the http://feeds.feedburner.com/techsnapmp3 feed link using podfox,

$ podfox episodes ts                                                                               
419: Nebulous Networking                  |  Downloaded
395: The ACME Era                         |  Downloaded
394: All About Azure                      |  Downloaded
393: Back to our /roots                   |  Downloaded
392: Keeping up with Kubernetes           |  Downloaded
Episode 391: Firecracker Fundamentals     |  Downloaded
Episode 390: What’s Up with WireGuard     |  Downloaded
Episode 389: The Future of HTTP           |  Downloaded
Episode 388: The One About eBPF           |  Downloaded
Episode 387: Private Cloud Building Bloc  |  Downloaded
Episode 386: What Makes Google Cloud Dif  |  Downloaded
Episode 385: 3 Things to Know About Kube  |  Downloaded
Episode 384: Interplanetary Peers         |  Not Downloaded
Episode 383: The Power of Shame           |  Not Downloaded
Episode 382: Domestic Disappointments     |  Not Downloaded
Episode 381: Here Comes Cloud DNS         |  Not Downloaded
Episode 380: Terminal Fault               |  Not Downloaded
Episode 379: SegmentSmack is Whack        |  Not Downloaded
Episode 378: Two-Factor Fraud             |  Not Downloaded
Episode 377: Linux Under Pressure         |  Not Downloaded

the link opened in browser contains a lot of episodes(hundreds), including 426 which is the latest one, and 418 which should be listed in the podfox episodes.

Episodes Missing from feed.json

Hi there - I'm trying to import this feed, but not all of the episodes are showing up in feed.json

For example, if I look in the raw RSS feed, I see Episode 34, but it doesn't appear in feed.json

CleanShot 2021-09-28 at 11 34 42@2x

Crash: KeyError: 'podcast-directory'

On Arch Linux (https://aur.archlinux.org/packages/podfox-git/), podfox crashes:

$ podfox feeds                                               
Traceback (most recent call last):
  File "/usr/bin/podfox", line 11, in <module>
    load_entry_point('podfox==0.1.1', 'console_scripts', 'podfox')()                                                                                     File "/usr/lib/python3.5/site-packages/podfox/__init__.py", line 304, in main                                                                            pretty_print_feeds(available_feeds())                                                                                                                File "/usr/lib/python3.5/site-packages/podfox/__init__.py", line 221, in available_feeds                                                                 base = CONFIGURATION['podcast-directory']                                                                                                          KeyError: 'podcast-directory'

A way to fix this is to declare CONFIGURATION global:

def main():
...
        try:
            global CONFIGURATION
            CONFIGURATION = json.load(conf_file)

It is patched now for Arch Linux, however, other platforms or distros may also have this issue.

can't locate downloaded files

I've done:
podfox import
podfox update
podfox download
podfox episodes

The epidodes are marked "Downloaded" but are not found in the folder. I see audio.mp3 and feed.json there and nothing else. feed.json doesn't contain any hints about what the files might be called so that I can try find or locate.

Any ideas?
Thanks!

Edit -- I suspect that "audio.mp3" is a default filename used for all downloads in the podcast ("Freakonomics Radio")

Episodes

Hi,
Nice your program.
A good balance between features and length.
I don't know a lot of Python although I intend to improve my skills.
So, when I enter the command "podfox episodes " the first column is very small to my needs.
I think this can be solved with just one or two modifications to the code, but I can't figure where.
I already made one or two tries, but with no results.
Can you tell me please what I should change in order to have a larger first column.
Thanks in advance.
Cheers,
Luis

rename episodes

Please add an option to rename episodes to real names (possibly shorten ones), then you could keep the filenames as links or symlinks.

I'm thinking of naming it as something like:
S01E03-real_name_of_the_episode.mp3

thanks

Unfinished downloads

Hi

I have sometimes some downloads that does not finish. Podfox is waiting infinitely. I then have to break with crtl-C. Maybe special cases in function download_single.

I notice today that in rare cases, files are not complete.

Any idea ?

Thanks anyway fot this tool !

Pruning episodes

As part of download command or a separate prune command, delete podcast episodes that have been published prior to the specified time.

added a few options

thanks for your work, I've been using podget until now and i found you project much better.
I've added a few features that more suiting my use case and maybe other will benefit:

  1. I like my podcast all in one folder and without config files getting in the way so I added a line in the .podfox.json to put the config files in a different dir (I put them in ~/.podfox).
  2. made change so all podcast are downloaded to the same dir so it easy to find them all in one dir and no need to go from folder to folder.
  3. added option to import from a list so no need to run import for each feed. for now it works just if the list doesn't have feeds that was already added, not sure if I know how to fix it.
  4. added info on creating systemd service and timer.

I'm not py dev and all changes are pretty dirty but works, you can find them all here: https://github.com/amirsher/podfox

Record saved filename in json

Feature request: When downloading an episode, record the actual on-disk filename that gets saved, and then attach that to the episode entry in the json data file.

Reasoning/Background:

I use podfox on a particular subscription-only RSS feed. It's presumably doing some server-side CGI and redirection gymnastics to ensure that I'm me and to make it more difficult for people to guess filenames on a CDN. But the practical upshot is that my feed.json has entries like this (the X's represent the lengths of the hex guids/tokens, without revealing the actual tokens):

"url": "https://sphinx.acast.com/p/open/s/xxxxxxxxxxxxxxxxxxxxxxxx/e/xxxxxxxxxxxxxxxxxxxxxxxx/media.mp3?tk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&sig=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

And, once downloaded, filenames that look like this:

  • bd486f1926feeeeb047f6e9de7778f73.mp3
  • bddc170ae2c444054ed715c0d1d19804.mp3
  • be57ffa60d51fb23be13b3030dd078da.mp3
  • be5cb1f4471115732eb21dd651fe8c65.mp3
  • be8c74711e6dcbd7b8125abba201713f.mp3
  • bef9d1ed844c42bf52672fe418394fb3.mp3
  • bf2b99bb2a175f17d5fddb67d3855543.mp3

The guids in the file names don't seem to correlate with anything in the URL. Because this is a large feed that goes back quite a few years in history, I have 1,201 mp3 files and no way to tell which matches a given episode. Ideally, the feed json would have some way to match episode to filename.

Suggestion: Mimetypes by type without subtype

It's been a while since I dug into this project (just haven't been following any podcasts these days), but with a recent update over mimetypes a thought popped in my mind.

I figured I'd add it here since I'm in no state to set up and test myself right now.

Perhaps use either a split("/") or str.startswith() to test the first half of the mimetype only.

As all mimetypes podfox works with are either audio or video types, this would save managing the subtypes in a list.

Possible code around line 195:

if hasattr(link, 'type') and (link.type.split("/")[0] in ("audio", "video")):

If nothing else, it's something I'm sure someone can bang their head against and come up with a solution to

Error with pip install

Hi,

I just try to install podfox and I have this error, do you know how I can solve it?

Downloading/unpacking podfox
  Downloading podfox-0.1.2.tar.gz
  Running setup.py (path:/tmp/pip-build-JLFnjG/podfox/setup.py) egg_info for package podfox
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip-build-JLFnjG/podfox/setup.py", line 3, in <module>
        with open('requirements.txt') as f:
    IOError: [Errno 2] No such file or directory: 'requirements.txt'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip-build-JLFnjG/podfox/setup.py", line 3, in <module>

    with open('requirements.txt') as f:

IOError: [Errno 2] No such file or directory: 'requirements.txt'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-JLFnjG/podfox
Storing debug log for failure in /home/podcastuser/.pip/pip.log```

Thanks in advance!

Error by import new feed

The installation works fine with python3!
I created the podfox configuration file but it doesn't work

podcastuser@xxx:~$ podfox import http://radiofrance-podcast.net/podcast09/rss_14522.xml nora_hamzawi
Traceback (most recent call last):
  File "/usr/local/bin/podfox", line 9, in <module>
    load_entry_point('podfox==0.1.1', 'console_scripts', 'podfox')()
  File "/usr/local/lib/python3.4/dist-packages/podfox-0.1.1-py3.4.egg/podfox/__init__.py", line 300, in main
    shortname=arguments['<shortname>'])
  File "/usr/local/lib/python3.4/dist-packages/podfox-0.1.1-py3.4.egg/podfox/__init__.py", line 86, in import_feed
    folder = get_folder(shortname)
  File "/usr/local/lib/python3.4/dist-packages/podfox-0.1.1-py3.4.egg/podfox/__init__.py", line 60, in get_folder
    base = CONFIGURATION['podcast-directory']
KeyError: 'podcast-directory'
podcastuser@xxx:~$ cat .podfox.json 
{
    "podcast-directory" : "/home/podcastuser/podcasts",
    "maxnum"            : 5
}

Thanks

Crash On Precise

After install, I tried:

podfox import http://feeds.feedburner.com/techsnapmp3

It gave me the following error:

Traceback (most recent call last):
  File "/usr/local/bin/podfox", line 11, in <module>
    load_entry_point('podfox==0.1.2', 'console_scripts', 'podfox')()
  File "build/bdist.linux-i686/egg/pkg_resources/__init__.py", line 564, in load_entry_point
    
  File "build/bdist.linux-i686/egg/pkg_resources/__init__.py", line 2608, in load_entry_point
    
  File "build/bdist.linux-i686/egg/pkg_resources/__init__.py", line 2268, in load
    
  File "build/bdist.linux-i686/egg/pkg_resources/__init__.py", line 2274, in resolve
    
  File "/usr/local/lib/python2.7/dist-packages/podfox/__init__.py", line 52
    Fore.RESET + Back.RESET + Style.RESET_ALL, file=sys.stderr)

episodes all have same name

All mp3s of my podcast are named media.mp3, so that each new download overwirtes the last one.

How do I reset podfox. I can't find out how to download the first episode that is now overwritten...

KeyError: 'maxage-days'

On a fresh install of podfox with the recommended config in my local .podfox.json I get the following error when I try to download an episode:

$ podfox download jupiter
Traceback (most recent call last):
  File "/home/ben/PythonEnvs/podfox_env/bin/podfox", line 33, in <module>
    sys.exit(load_entry_point('podfox==0.1.1', 'console_scripts', 'podfox')())
  File "/home/ben/PythonEnvs/podfox_env/lib/python3.9/site-packages/podfox-0.1.1-py3.9.egg/podfox/__init__.py", line 401, in main
    download_multiple(feed, maxnum)
  File "/home/ben/PythonEnvs/podfox_env/lib/python3.9/site-packages/podfox-0.1.1-py3.9.egg/podfox/__init__.py", line 227, in download_multiple
    if not episode['downloaded'] and not episode_too_old(episode, CONFIGURATION['maxage-days']):
KeyError: 'maxage-days'

It looks like maxage-days is missing from the default config. If I add maxage-days to my local config the download works fine. I've created a small change to fix this and I'll create a pull request for it shortly.

Download

Hi,
This is an issue :)
If I already have downloaded all the episodes for a feed and if I enter the command "podfox download" it will download again the last five episodes (at this moment I only have one feed).
I think it would be nice and easy to say "No new episodes to download.".
When I improve my skills, maybe I can try to manage this :)
Anyway, I think it would be a nice improvement to the base version.
Cheers,
Luis

Create an Internal ID for Podcasts

To make it easier to add other features like downloading specific podcasts, it would be a good idea to add an ID attribute for podcast records. Using a straight numeric ID would not be ideal as there may be cases where the numbers to get out of sync.

To create a safe unique identifier, you can create a short hash of the podcast audio URL as follows:

import hashlib
feed_url="https://media.transistor.fm/9c4b292f/754f684f.mp3"
feed_id=hashlib.shake_256(feed_url.encode()).hexdigest(5)

This will create a short 10 character hash that would be unique for every feed regardless of the changes to the feeds. As long as the feed does not re-use podcast URLs, there should be no collisions.

This ID should be stored in the feed.json as id and it can be used to download specific podcasts.

Published

Hi,
I assume the that the field "published" of the "feed.json" file represents a time. Is it?
In that case, I would like to know:
1 - Which time is it?
2 - How can I convert it to a readable date and time?
Thanks in advance.
Cheers,
Luis

feedburner feeds

$ podfox import https://feeds.feedburner.com/BeersWithTalosPodcast.rss
imported Beers with Talos Podcast with shortname beers-with-talos-podcast

$ podfox update beers-with-talos-podcast
updating Beers with Talos Podcast


$ cat beers-with-talos-podcast/feed.json
{
    "episodes": [],
    "shortname": "beers-with-talos-podcast",
    "title": "Beers with Talos Podcast",
    "url": "https://feeds.feedburner.com/BeersWithTalosPodcast.rss"
}%                                                                                                                                                                                           

Empty list of episodes, the rss feed seems valid, is there a known issue with feedburner feeds?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.