Giter Site home page Giter Site logo

gpodder-core's Introduction

      ___         _    _           ____
 __ _| _ \___  __| |__| |___ _ _  |__ /
/ _` |  _/ _ \/ _` / _` / -_) '_|  |_ \
\__, |_| \___/\__,_\__,_\___|_|   |___/
|___/
        Media aggregator and podcast client

Copyright 2005-2022 The gPodder Team

License

gPodder is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

gPodder is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Dependencies

As an alternative to python-dbus on Mac OS X and Windows, you can use the dummy (no-op) D-Bus module provided in "tools/fake-dbus-module/".

For quick testing, see Run from Git to install dependencies.

GTK3 UI - Additional Dependencies

Optional Dependencies

  • Bluetooth file sending: gnome-obex-send or bluetooth-sendto
  • Size detection on Windows: PyWin32
  • Native OS X support: ige-mac-integration
  • MP3 Player Sync Support: python-eyed3 (0.7 or newer)
  • iPod Sync Support: libgpod (tested with 0.8.3)
  • Clickable links in GTK UI show notes: html5lib
  • HTML show notes: WebKit2 gobject bindings (webkit2gtk, webkitgtk4 or gir1.2-webkit2-4.0 packages).
  • Better Youtube support (> 15 entries in feeds, download audio-only): youtube_dl or yt-dlp

Build Dependencies

  • help2man
  • intltool

Test Dependencies

  • python-minimock
  • pytest
  • pytest-httpserver
  • pytest-cov
  • desktop-file-utils

Testing

To run tests, use...

make unittest

To set a specific python binary set PYTHON:

PYTHON=python3 make unittest

Tests in gPodder are written in two different ways:

If you want to add doctests, simply write the doctest and make sure that the module appears after --doctest-modules in pytest.ini. If you add tests to any module in src/gpodder you have nothing to do.

If you want to add unit tests for a specific module (ex: gpodder.model), you should add the tests as gpodder.test.model, or in other words:

The file:       src/gpodder/model.py
is tested by:   src/gpodder/test/model.py

After you've added the test, make sure that the module appears in "test_modules" in src/gpodder/unittests.py - for the example above, the unittests in src/gpodder/test/model.py are added as 'model'. For unit tests, coverage reporting happens for the tested module (that's why the test module name should mirror the module to be tested).

Running and Installation

To run gPodder from source, use..

bin/gpodder              # for the Gtk+ UI
bin/gpo                  # for the command-line interface

To install gPodder system-wide, use make install. By default, this will install all UIs and all translations. The following environment variables are processed by setup.py:

LINGUAS                  space-separated list of languages to install
GPODDER_INSTALL_UIS      space-separated list of UIs to install
GPODDER_MANPATH_NO_SHARE if set, install manpages to $PREFIX/man/man1

See setup.py for a list of recognized UIs.

Example: Install the CLI and Gtk UI with German and Dutch translations:

export LINGUAS="de nl"
export GPODDER_INSTALL_UIS="cli gtk"
make install

The "make install" target also supports DESTDIR and PREFIX for installing into an alternative root (default /) and prefix (default /usr):

make install DESTDIR=tmp/ PREFIX=/usr/local/

Debian and Ubuntu use dist-packages instead of site-packages for third party installs, so you'll want something like:

sudo python3 setup.py install --root / --prefix /usr/local --optimize=1 --install-lib=/usr/local/lib/python3.10/dist-packages

In fact, first try running python -c "import sys; print(sys.path)" to check what is the exact path. It depends on your version of python.

Portable Mode / Roaming Profiles

The run-time environment variable GPODDER_HOME is used to set the location for storing the database and downloaded files.

This can be used for multiple configurations or to store the download directory directly on a MP3 player or USB disk:

export GPODDER_HOME=/media/usbdisk/gpodder-data/

OS X Specific Notes

  • default GPODDER_HOME="$HOME/Library/Application Support/gPodder"
  • default GPODDER_DOWNLOAD_DIR="$HOME/Library/Application Support/gPodder/download"

These settings may be modified by editing the following file of the .app :

/Applications/gPodder.app/Contents/MacOSX/_launcher

Add and edit the following lines to alter the launch environment on OS X :

export GPODDER_HOME="$HOME/Library/Application Support/gPodder"
export GPODDER_DOWNLOAD_DIR="$HOME/Library/Application Support/gPodder/download"

Changing the Download Directory

The run-time environment variable GPODDER_DOWNLOAD_DIR is used to set the location for storing the downloads only (independent of the data directory GPODDER_HOME):

export GPODDER_DOWNLOAD_DIR=/media/BigDisk/Podcasts/

In this case, the database and settings will be stored in the default location, with the downloads stored in /media/BigDisk/Podcasts/.

Another example would be to set both environment variables:

export GPODDER_HOME=~/.config/gpodder/
export GPODDER_DOWNLOAD_DIR=~/Podcasts/

This will store the database and settings files in ~/.config/gpodder/ and the downloads in ~/Podcasts/. If GPODDER_DOWNLOAD_DIR is not set, $GPODDER_HOME/Downloads/ will be used if it is set.

Logging

By default, gPodder writes log files to $GPODDER_HOME/Logs/ and removes them after a certain amount of times. To avoid this behavior, you can set the environment variable GPODDER_WRITE_LOGS to "no", e.g:

export GPODDER_WRITE_LOGS=no

Extensions

Extensions are normally loaded from gPodder's "extensions/" folder (in share/gpodder/extensions/) and from $GPODDER_HOME/Extensions/ - you can override this by setting an environment variable:

export GPODDER_EXTENSIONS="/path/to/extension1.py extension2.py"

In addition to that, if you want to disable loading of all extensions, you can do this by setting the following environment variable to a non- empty value:

export GPODDER_DISABLE_EXTENSIONS=yes

If you want to report a bug, please try to disable all extensions and check if the bug still appears to see if an extension causes the bug.

More Information

gpodder-core's People

Contributors

brot avatar drmikecrowe avatar elelay avatar keeper-of-the-keys avatar phlixi avatar stefankoegl avatar sthocs avatar svetlemodry avatar thp avatar yepoleb avatar

Stargazers

 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

gpodder-core's Issues

Gpodder gui doesn't work in Win10

I've installed all the requirements, and gpodder gui does not appear to work in Windows 10. There is nothing in the console if it I run it from the command line. There is no crash output. Running the file doesn't result in any output or any window.

Still in development?

Is gpodder v4 still relevant? I came across its enhanced gpo CLI utility, and consequently noticed that the latest blog update about it was published in May 2015.

Are there any chances of some features being backported?

Wishlist - Add per section sources update

Hello,

I have a lot of sources in my gpodder program classified by sections. It would be great to implement the possibility to update each section individually without updating the whole subscriptions list.

Thanks and congratulations for gpodder!

Alberto.

:)

handle soundcloud permissions

(opening a new to bring it out of a comment on a close PR).

Try this feed: https://soundcloud.com/user-588924363
I created it so that each track had different permissions.

When every permission is disabled (White track), getting track metadata fails, so the track is silently skipped (doesn't show up in gPodder).

Else, either enable direct download, offline listening or enable app playback is activated.
Then we always get stream and download urls.

permission streamable downloadable retrieve stream_url retrieve download_url
offline listening False False 401 401
enable app playback True False OK 401
enable direct download False True 401 OK

Encoding issue in Windows

Running gpo (gpodder-core) from command line results in an encoding error. The quick fix was to run
chcp 65001 to enable Unicode in cmd.exe before running it.

here's the output without the above command:

2016-06-02 15:42:17,379 [gpodder.log] ERROR: Uncaught exception: Traceback (most recent call last):
  File "gpo", line 1236, in <module>
    cli._shell()
  File "gpo", line 1092, in _shell
    """ % gpodder.__dict__).splitlines()))
  File "gpo", line 183, in out
    print(*args, **kwargs)
  File "C:\Users\[redacted]\AppData\Local\Programs\Python\Python35-32\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\xa9' in position 67: character maps to <undefined>

Youtube parser fails to find channel feed when ID contains a "-"

Valid youtube ID's for channels can contain a dash character. The current youtube plugin implementation only treats alphanumerics as valid channel ID characters.

Passing generic non-rss feeds fend to fail. For example:
https://www.youtube.com/channel/UCrUXL60iLgwjMowTF-toqWA
yt:UCrUXL60iLgwjMowTF-toqWA

But a manual request explicitly to the rss feed such as the following (for the same channel) succedes.
https://www.youtube.com/feeds/videos.xml?channel_id=UCrUXL60iLgwjMowTF-toqWA

It appears that the problem is related to the regex pattern used around line 185 of /src/gpodder/plugins/youtube.py

Invalid keyword argument 'season'

Feed changes appear to break the code.

Steps to reproduce:

$ pip install -r requirements.txt
$ bin/gpo

gpo> subscribe https://feeds.megaphone.fm/sciencevs sciencevs

Results:

Subscribing to https://feeds.megaphone.fm/sciencevs                       [FAIL]
bin/gpo:382: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
  logger.warn('Cannot subscribe: %s', e, exc_info=True)
2023-03-25 08:41:52,432 [gpo] WARNING: Cannot subscribe: "Invalid keyword argument(s): {'season'}"
Traceback (most recent call last):
  File "bin/gpo", line 366, in subscribe
    podcast = self._get_podcast(url, create=True)
  File "bin/gpo", line 337, in _get_podcast
    return self._model.load_podcast(url, create=True)
  File "/tmp/gpodder-core/src/gpodder/model.py", line 998, in load_podcast
    return self.PodcastClass.load_(self, url, create, authentication_tokens)
  File "/tmp/gpodder-core/src/gpodder/model.py", line 666, in load_
    tmp.update()
  File "/tmp/gpodder-core/src/gpodder/model.py", line 793, in update
    self._consume_custom_feed(result)
  File "/tmp/gpodder-core/src/gpodder/model.py", line 734, in _consume_custom_feed
    new_episodes, seen_guids = custom_feed.get_new_episodes(self)
  File "/tmp/gpodder-core/src/gpodder/plugins/podcast.py", line 153, in get_new_episodes
    episode = channel.episode_factory(episode_dict.items())
  File "/tmp/gpodder-core/src/gpodder/model.py", line 698, in episode_factory
    return self.EpisodeClass(self, **dict(iterable))
  File "/home/mcrowe/.local/lib/python3.8/site-packages/minidb.py", line 703, in model_init
    raise KeyError('Invalid keyword argument(s): %r' % unmatched_kwargs)
KeyError: "Invalid keyword argument(s): {'season'}"
"Invalid keyword argument(s): {'season'}"

Fix deprecation warning with `getargspec`

./bin/gpo:1146: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
  args, varargs, keywords, defaults = inspect.getargspec(func)

SSL cert verification fails if file episode URL returns a 301 to another domain

When I tried to download a recent episode of the Resonator podcast the download didn't even start. After looking at the stdout output of gPodder I saw it's an issue with certificate verification.
The problem occured with gpodder-sailfish 4.6 on SailfishOS 2.1.0.9

stdout output of gPodder including a stacktrace

I think it's the chaining of redirects and mixture of http and https links which causes the issue here. In case the setup of the podcast page changes, I document here what's currently happening:

  • the feed links to the episode file via unencrypted http: http://resonator-podcast.de/podlove/file/3054/s/feed/c/opus/RES101_Dementia_Care_Management.opus
  • this link returns an HTTP 301 permanent redirect to https://files.wrint.de/RES101_Dementia_Care_Management.opus?ptm_source=feed&ptm_context=opus&ptm_request=84e16c95afa2&ptm_file=RES101_Dementia_Care_Management.opus . This is a different domain and also now https encrypted
  • the location redirected to works fine when opened inside a browser. It also has a valid certificate by Comodo (so no obscure CA) which is only valid for files.wrint.de

I suspect this unusual setup to be the cause of this issue.

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.