Commit Graph

317 Commits

Author SHA1 Message Date
luzpaz 8a995cb097 Fix various typos
Found via `codespell -q 3 -S *.po -L bloc,extracter,parms`
2023-07-14 12:13:50 +00:00
auouymous b0ce535ca9 Add a View menu option to show time in the episode released column. 2023-04-29 21:10:33 -06:00
auouymous a3cf8b96ed
Merge pull request #1297 from tpikonen/update-really-new
Treat only really new episodes as new after an update
2023-02-07 02:08:21 -07:00
auouymous 7c2b8621a3 Document the episode description fields. 2023-01-12 15:04:26 -07:00
auouymous 9d46b2d3de Add comment about unknown external files for youtube-dl/yt-dlp downloads. 2023-01-12 04:10:08 -07:00
Teemu Ikonen 2552e6e0ec Treat only really new episodes as new after an update
Make PodcastChannel.update() return a list of new episodes. Add a new
config variable ui.gtk.only_added_are_new. If this variable is True,
download, queue or show (depending on the value of config var
auto_download) only these new episodes, instead of all episodes marked
as new, after an update.
2023-01-06 13:55:07 +02:00
auouymous 6e38e1b527 Set error icon for episodes with invalid URLs. 2022-12-15 06:08:47 -07:00
auouymous 2e7b1678d4 Don't discard episodes with invalid urls and links. 2022-12-15 05:50:27 -07:00
auouymous b39edcfe83 max_episodes_per_feed -> limit.episodes 2022-12-08 15:37:36 -07:00
Teemu Ikonen d87ac85506 Fix 'W504 line break after binary operator' flake8 warnings
Fixed by running

autopep8 -i -r --select=W504 .

and some hand tuning.
2022-11-14 18:32:09 +02:00
Teemu Ikonen 6bd0bb0530 Remove unused imports and pass statements
Fixes flake8 error F401.
Most errors were fixed by running

autoflake -i -r --remove-all-unused-imports .

which also removes unnecessary 'pass' statements, some by hand-editing.
2022-11-14 18:32:09 +02:00
auouymous 1b9ed37064
Merge pull request #1382 from tpikonen/ytdl-rename
Fix yt-dlp output file name
2022-11-14 04:08:49 +00:00
Teemu Ikonen 9690b13a3a Get preview file name from CustomDownload.partial_filename
Add 'custom_downloader' member var to DownloadTask. Use it in
episode.get_playback_url() to get a preview file name.

Also add episode.can_preview() method and use it in ep.can_play().
2022-11-07 15:28:54 +02:00
auouymous 5c01b6b036 Fix crash on older versions of python.
Older versions of python do not treat None as False. This causes
set_sensitive() to crash when None is returned from can_pause().

Fixes #1394.
2022-09-12 14:16:31 -06:00
auouymous 15fa2d4be9 Revert "Fix #864 add undownload checkbox in delete episode confirm dialog (#1284)"
This reverts commit 5eeda318f4.
2022-06-22 14:21:40 -07:00
Eric Le Lay 0acaee4ef9 get chapters from feedparser 2022-06-19 11:56:12 -06:00
auouymous 0fe74c18d2 Generate HTML episode description only when needed.
PR #1094 generated an HTML description for any episode that lacked one.
That however increased the database size (almost double in worst case)
because it was storing both text and html versions of each description.
This fixes that by storing the episode thumbnail URL in the database and
generating the HTML description only when shownotes are drawn.

The text description is now cleared for episodes with an HTML
description. This further reduces database size for feeds that provide
both. It also fixes an issue for feeds that provide different text and
HTML descriptions, because the short description would show the text
description and shownotes would show the HTML description. And EQL only
searched the text descriptions, which might not match what the user sees
in the shownotes.
2022-06-19 11:56:12 -06:00
auouymous 97d9459b90 Add episode art URL and chapters to database.
Co-authored-by: Eric Le Lay <elelay@macports.org>
2022-06-19 11:56:12 -06:00
Eric Le Lay 5eeda318f4
Fix #864 add undownload checkbox in delete episode confirm dialog (#1284)
* Fix #864 add undownload checkbox in delete episode confirm dialog

don't mark episodes new if we don't delete them now

when a mix of downloaded and not downloaded and old episodes
are selected
2022-05-13 01:35:32 -07:00
auouymous 41c312dd68 Change deprecated logger.warn() to logger.warning(). 2022-04-29 02:54:32 -06:00
auouymous f49068311e
Merge pull request #1272 from auouymous/show-episodes-without-enclosures
Show episodes without downloadable content.
2022-04-26 00:12:58 -07:00
auouymous 1cc7941331 Show episodes without downloadable content.
Non-media RSS feeds only have a textual description and can't be
subscribed to in gpodder. Some media feeds lack downloadable content and
can only be accessed from the website. In both cases, gpodder removes
the episodes without any feedback to the user as to why, making it
appear to be a problem in gpodder.

This patch adds those episodes but prevents automatic download and
displays a proper error when a manual download is attempted. The
episodes also get a web browser icon to indicate they lack downloadable
content. While not downloadable or transferable to media devices,
gpodder can be used to notify the user when new episodes are available
and they can be accessed by clicking through to the website
2022-04-19 01:24:20 -06:00
auouymous 8cefb936c5 Allow toggling lock of any locked or undeleted episode.
This allows undownloaded episodes to be locked with both menus and
guarantees both menus remain consistent.
2022-04-10 03:48:59 -06:00
auouymous 182abc575b Refactor play_or_download() progress tab action code.
Fixes an issue with the toolbar cancel button turning off and on when
entering the progress tab, even though it can't cancel anything until a
selection is made.

Properly cancels failed tasks manually removed from progress tab. Not
cancelling would leave the error icon and prevent downloading or
cancelling.

The download, pause and cancel actions in toolbar and Episodes
menu can now be used to control downloads in the progress tab. The
delete menu item in Episodes menu removes the download from list. This
also allows keyboard accelerators to be used, such as the Delete key
for removing tasks. Accelerators for cancel, and maybe download/pause,
should added in a future PR.

The progress tab context menu now has the same ordering as the other
menus.
2022-03-23 18:53:38 -06:00
auouymous 01cd2696f7 Refactor play_or_download() episode action code.
Streaming was always possible (#867) for all audio and video episodes if
an audio player was configured. Now it is only possible if a player is
configured for the episode's type.

Methods have been added to PodcastEpisode that are either now used by
actions or replicate the conditions used by actions to filter
selections. This will help prevent mismatched conditions between
play_or_download() and episode actions. And play_or_download() is easier
to reason about and should prevent future bugs such as #1250.

Fixes #1250.
2022-03-20 02:50:46 -06:00
auouymous 20dd397e9e Memoize youtube channel ID and feed data.
Internal youtube support and the youtube-dl extension both cause the
youtube feed URL to be fetched three times per update. Caching the feed
data from feedcore allows internal support to only load the feed once.
The lru_cache removes one of the youtube-dl fetches, not perfect, but
two is better than three. I saw a 40% decrease in update times when
using the internal youtube code.

Throwing an exception from get_channel_id_url() prevents get_cover() and
get_channel_desc() from attempting to fetch a None URL, and provides
more accurate errors.

The lru_cache on get_youtube_id() saves 1ms per youtube channel when
updating. Which adds up with a lot of channels, and might be more on
slower devices.
2022-02-27 02:52:06 -07:00
blushingpenguin 3c322b610a Merge branch 'master' into queue 2021-08-31 14:42:20 +01:00
blushingpenguin 68195acc00 #1117, #1137: fixes for pause/resume/cancelling download tasks 2021-08-30 15:45:20 +01:00
auouymous bba167b811 Query duration for youtube episodes when not using youtube-dl.
The duration is not available in the youtube feed and requires a request
for each episode. It was set when downloading but the user had no way of
knowing how long an episode was before downloading it. Live streams do
not have a duration until they end, and remain blank until downloaded or
the next update.

This will increase the time it takes to update feeds, with new
subscriptions possibly taking 16x longer to update due to the 16
requests vs the previous single request. Updating existing feeds
will only have an additional request for each new episode.
2021-08-14 23:09:07 -06:00
Eric Le Lay f74eba2e72 fix #1099 folder not escaped when podcast renamed from dialog 2021-08-12 11:15:06 +02:00
auouymous b0ebfd5333 Create an html description when none provided.
The youtube-dl extension code is moved into gPodder to provide this
feature for all feeds lacking an html description. This enables
clickable links inside non-html descriptions. And if available, an image
tag for the episode art URL is prepended to the html description
(currently only available in html shownotes).
2021-07-16 21:03:38 -06:00
Eric Le Lay 56e8f4755f
Merge pull request #949 from tpikonen/ytdl-streaming
Allow episodes with youtube-dl compatible URLs
2021-05-16 17:44:48 +02:00
auouymous 1e10a4f9bd Show error icon on episodes that fail to download. 2021-05-14 20:24:50 -06:00
Teemu Ikonen 482f3d40dc Improve media detection when parsing feeds
Skip image and application URLs in enclosure if media with audio or
video is found, or if a CustomDownloader exists for episode.link URL.
2021-05-12 19:16:35 +03:00
Teemu Ikonen 11407b0c96 Accept episodes if RSS link URL has a custom_downloader 2021-03-10 15:29:03 +02:00
auouymous d9d83a36e7 Show URL that caused invalid feed error
The error may originate from another page in the feed, and only showing
the original URL makes it harder to track down invalid feed issues
(see #967).
2021-03-02 20:38:47 -07:00
Teemu Ikonen 0e94386bd3 Use raw strings in regexp patterns, fix DeprecationWarnings 2021-01-15 13:48:21 +02:00
Teemu Ikonen 031f8e4350 Skip episode media with 'application/*' mime type, if there is video or audio 2021-01-10 23:07:13 +02:00
Eric Le Lay e632bfdbde Merge remote-tracking branch 'origin/master' into requests 2020-11-24 09:23:28 +01:00
Eric Le Lay d87466f609
Merge pull request #839 from gpodder/fix-796-mkv-files
Fix #796 MKV Files Not Properly Renamed
2020-09-14 08:22:39 +02:00
auouymous bc62e3bb4c Youtube live streaming support 2020-09-12 02:34:39 -06:00
Eric Le Lay dd165747b3 fix paginated feeds: res.feed already a PodcastParsedFeed
try with e.g. http://blog.binaergewitter.de/rss.xml
2020-09-11 17:23:43 +02:00
Eric Le Lay 463e460170 Merge remote-tracking branch 'origin/master' into requests 2020-09-11 17:07:03 +02:00
Eric Le Lay 5fe4ca3283 fix isort warnings 2020-09-07 11:40:54 +02:00
auouymous 127034bfa6 Discard episode when its GUID collides with a newer episode. 2020-07-21 03:25:29 -06:00
Eric Le Lay 7c551ee6aa gpodder escapist_videos doesn't work with escapist magazine v2 2020-07-18 15:13:43 +02:00
Eric Le Lay 12912bed3e fix naive access to response.text
bytes for xml, utf-8 fallback for html, known encoding if available
2020-07-18 15:04:04 +02:00
Eric Le Lay 48d851d292 rework feedcore.Fetcher interface to allow reusing it in custom channel parsers 2020-07-14 18:43:44 +02:00
Eric Le Lay 3babb86c70 use requests package for util.urlopen
now a requests.Response is returned instead of the file-like object from urllib.
Fixed all usages of util.urlopen: it simplifies getting json, text encoding detection.
In particular feedcore (responsible for fetching feeds) is simplified.

This is a first pass and could benefit from better usage of the requests api
(Sessions for instance, to keep connection pools)

TODO: download.py
2020-07-11 17:42:28 +02:00
Eric Le Lay a4546b463f reduce MAX_FILENAME_WITH_EXT_LENGTH to account for youtube-dl appending the extension
eg. xxx.webm.partial.webm
2020-07-10 15:59:15 +02:00