Commit Graph

104 Commits

Author SHA1 Message Date
Paul van Tilburg 94121c0828
Apply a default item limit of 50 2022-12-23 22:17:55 +01:00
Paul van Tilburg 8e73deb042
Mention YouTube support in the public documentation 2022-12-23 22:17:55 +01:00
Paul van Tilburg 3a3fbc96f4
Use a MIME DB to determine the download URL file extensions
* Also apply it to the default MIME type for Mixcloud posts
* Add a dependency on the `mime_db` crate
2022-12-23 22:17:55 +01:00
Paul van Tilburg 59e1f8a987
Add first version of the YouTube back-end 2022-12-23 22:17:52 +01:00
Paul van Tilburg 66452cc96d
Add more lints
Not enabling the `trivial_casts` lint, because the `uri!` seems to
trigger it.
2022-10-17 20:10:06 +02:00
Paul van Tilburg 32040f3b0f
Cargo update 2022-10-17 19:51:33 +02:00
Paul van Tilburg bde6135f70
Use public URL instead of URL in configuration
Change the name of the `url` config key to `public_url` to be more clear
about what it is for.
2022-10-17 19:51:24 +02:00
Paul van Tilburg fa8fc40b58
Add missing trait derives on back-end types 2022-08-15 21:07:53 +02:00
Paul van Tilburg 101df7d486
Add missing/fix cache-related comments 2022-08-15 20:24:13 +02:00
Paul van Tilburg 76f1e01657
Make channel/item image optional; change item length type
This allows more back-ends to be compatible.
2022-08-15 20:22:15 +02:00
Paul van Tilburg 49e0e47ba2
Introduce enum and enum dispatching for backends
This way handlers don't need to do case matching on backend ID strings
anymore.

* Rename `backend` to `backend_id` where we have a backend ID
* Add `get` function and `Backends` enum to the `backend` module
* Add a depend on the `enum_dispatch` crate
2022-08-15 20:21:42 +02:00
Paul van Tilburg cb40f6b192
Split off feed generation to feed module
Also rename the handler function names so they don't conflict with
(current and future) modules.
2022-08-14 10:16:05 +02:00
Paul van Tilburg bc9a9e307d
Add back-end abstraction; refactor Mixcloud back-end (closes: #10)
* Add a `backend` module `Backend` trait and necessary abstract types
* Refactor handlers to use the back-end abstraction
* Directly serialize to URLs where necessary in Mixcloud back-end
* Require `serde` feature for the url crate
2022-08-14 09:03:58 +02:00
Paul van Tilburg 218e714b03 Bump dependency on cached to 0.38.0
This fixes the unused `*_prime_cache` compile warnings.
2022-08-12 09:53:56 +02:00
Paul van Tilburg 5cb476c7e2 Cargo update 2022-08-12 09:53:29 +02:00
Paul van Tilburg 01ca8165e1 Fix string type 2022-08-12 09:52:23 +02:00
Paul van Tilburg 45cb7faed9
Cargo update 2022-07-17 16:29:36 +02:00
Paul van Tilburg 8e77e35690
Add missing error documentation; tweak messages 2022-06-05 21:58:02 +02:00
Paul van Tilburg e585a8cf59
Fix (doc)test failure 2022-06-05 20:56:17 +02:00
Paul van Tilburg 9ae7ea8eb4
Simplify launching Rocket 2022-06-05 20:54:48 +02:00
Paul van Tilburg 679a73ab63
Refactor limit handling to be more readable 2022-05-28 09:29:31 +02:00
Paul van Tilburg 45fca01e27
Fix typo in the changelog 2022-05-27 23:01:26 +02:00
Paul van Tilburg 61db7c4b76
Update the changelog 2022-05-27 22:59:29 +02:00
Paul van Tilburg 8c0bfd766a
Bump the version to 0.2.0 2022-05-27 22:59:29 +02:00
Paul van Tilburg 27a40b1a91
Increase TTL for redirect URI to 24 hours 2022-05-27 22:59:28 +02:00
Paul van Tilburg dafcdc009b Merge pull request 'Implement paging' (#9) from 2-implement-paging into main
Reviewed-on: #9
2022-05-27 22:50:51 +02:00
Paul van Tilburg 0701088fbc
Update the documentation 2022-05-27 22:47:52 +02:00
Paul van Tilburg c13ce71c69
Add feed item limit support
* The feed item limit defaults to the default page size (50) if not
  provided
* Move caching from response to URL fetch results; add helper functions
* Add a helper function to set the paging query of an URL
* Modify paging so we don't retrieve more than the feed item limit
2022-05-27 22:47:52 +02:00
Paul van Tilburg 78fc93fedf
Retrieve all pages by following the next URL
* Derserialize the paging information
* Parse each next URL; handle URL parse errors
* Use a default page size of 50; pass offset 0 to count by item index
2022-05-27 22:47:52 +02:00
Paul van Tilburg 09ee0b9ba9
Make default_file_type functions const 2022-05-27 22:39:53 +02:00
Paul van Tilburg 10bbd9b495
Cargo update 2022-05-26 22:12:31 +02:00
Paul van Tilburg cde2a34e91
Fix documentation 2022-05-26 22:12:01 +02:00
Paul van Tilburg 11c78a6cc8
Drop the get_ prefix for functions 2022-05-26 21:25:37 +02:00
Paul van Tilburg 11b32acfb4
Use an URL parser for the URL passed to youtube-dl 2022-05-26 21:23:38 +02:00
Paul van Tilburg 451c07a09e
Implement caching (closes: #3)
* Enable the `async` feature for the `cached` crate
* Make the types that we cache implement `Clone`
* Rename the argument of mixcloud::redirect_url` because of this issue:
  https://github.com/jaemk/cached/issues/114
2022-05-26 21:20:10 +02:00
Paul van Tilburg b4c0188fba
Drop some unnecessary bloat/unused crates 2022-05-26 20:40:18 +02:00
Paul van Tilburg 3ec1879932
Replace own youtube-dl impl by youtube_dl crate (refs: #8)
* Drop the depend on the `tokio` crate, because we don't need to
  run our own processes anymore.
* Remove unnecessary error variant for command failure
2022-05-26 20:38:51 +02:00
Paul van Tilburg a67df934bf
Enable some more lints; fix clippy issues 2022-05-26 20:03:44 +02:00
Paul van Tilburg b53365a293
Implement proper error logging and handling (closes: #6)
* Use the `thiserror` crate to make our own error type
* Implement Rocket's `Responder` type for the error type
* Adjust all methods to use the error type
* Small documentation tweaks
2022-05-26 19:57:24 +02:00
Paul van Tilburg 9d1bfd8351
Add a changelog 2022-05-24 11:28:10 +02:00
Paul van Tilburg 326a29480b
Install the templates; set env var for location 2022-05-24 11:28:09 +02:00
Paul van Tilburg 8afd4b17ba
Add a simple index page that explains the usage 2022-05-24 11:05:59 +02:00
Paul van Tilburg fb02ddd242
Clarify it more with an example URL 2022-05-24 10:51:37 +02:00
Paul van Tilburg 4ff6d14859
Explain how to use the service; tweak text 2022-05-24 10:49:02 +02:00
Paul van Tilburg 18f4a5f575
Add feed category and iTunes extension attributes 2022-05-24 10:35:10 +02:00
Paul van Tilburg 85cc0b06b2
Second round of rework to make more podcast clients happy
* Prefix the feed handler path with '/feed'
* Mount both handlers under `/` now that they have a prefix in the path
* Provide the backend to the feed and download handler in their paths
* Use the ID as filename download handler, also add an extension
2022-05-24 10:04:06 +02:00
Paul van Tilburg a4546c1641
Use redirection instead of streaming
This might solve some issues with clients that don't get the file type
and size and don't know what to do?
Also, we're not longer involved in the download, yay! (For now.)
2022-05-23 22:21:38 +02:00
Paul van Tilburg 1ab89f87c4
Don't use Markdown link formatting 2022-05-23 22:20:02 +02:00
Paul van Tilburg fc2f200ee5
Also pass the backend to the download handler 2022-05-23 22:19:13 +02:00
Paul van Tilburg c6789d51fb
Add Debian packaging via cargo-deb
* Add the required metadata to `Cargo.toml`
* Add a systemd unit file
* Use `Rocket.toml.example` as the default configuration
2022-05-20 16:54:09 +02:00