Compare commits

..

No commits in common. "v0.4.0" and "v0.3.0" have entirely different histories.

6 changed files with 829 additions and 675 deletions

View File

@ -1,83 +0,0 @@
name: "Check, Test and Lint Using Cargo"
on:
- push
- pull_request
- workflow_dispatch
jobs:
check:
name: Check
runs-on: debian-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: https://github.com/actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Use sparse Cargo index for crates.io
run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml
- name: Run cargo check
uses: https://github.com/actions-rs/cargo@v1
with:
command: check
# TODO: Add a test suite first!
# test:
# name: Test Suite
# runs-on: debian-latest
# steps:
# - name: Checkout sources
# uses: actions/checkout@v3
#
# - name: Install stable toolchain
# uses: https://github.com/actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
#
# - name: Use sparse Cargo index for crates.io
# run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml
#
# - name: Run cargo test
# uses: https://github.com/actions-rs/cargo@v1
# with:
# command: test
# args: --all-features
lints:
name: Lints
runs-on: debian-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: https://github.com/actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Use sparse Cargo index for crates.io
run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml
- name: Run cargo fmt
uses: https://github.com/actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: https://github.com/actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

View File

@ -7,24 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.4.0] - 2023-03-24
### Added
* Add Gitea Actions workflow for cargo
### Changed
* Update dependencies on `cached` and `youtube_dl`
* Update to `rocket` version 0.5.0-rc.3
* Select MP4 audio streams only (experimental)
* Remove parameters from MIME types to prevent clients tripping over them
### Fixed
* Bump the dependency on `ytextract` (#14)
* Fix typo in the documentation
## [0.3.0] - 2022-12-24
### Added
@ -74,8 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Initial release.
[Unreleased]: https://git.luon.net/paul/podbringer/compare/v0.4.0...HEAD
[0.4.0]: https://git.luon.net/paul/podbringer/compare/v0.3.0..v0.4.0
[0.3.0]: https://git.luon.net/paul/podbringer/compare/v0.2.0..v0.3.0
[0.2.0]: https://git.luon.net/paul/podbringer/compare/v0.1.0..v0.2.0
[Unreleased]: https://git.luon.net/paul/podbringer/compare/v0.3.0...HEAD
[0.1.0]: https://git.luon.net/paul/podbringer/commits/tag/v0.1.0
[0.2.0]: https://git.luon.net/paul/podbringer/compare/v0.1.0..v0.2.0
[0.3.0]: https://git.luon.net/paul/podbringer/compare/v0.2.0..v0.3.0

1365
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package]
name = "podbringer"
version = "0.4.0"
version = "0.3.0"
authors = ["Paul van Tilburg <paul@luon.net>"]
edition = "2021"
description = "Web service that provides podcasts for services that don't offer them (anymore)"
@ -9,18 +9,18 @@ license = "MIT"
[dependencies]
async-trait = "0.1.57"
cached = { version = "0.42.0", features = ["async"] }
cached = { version = "0.41.0", features = ["async"] }
chrono = { version = "0.4.19", features = ["serde"] }
enum_dispatch = "0.3.8"
mime-db = "1.6.0"
reqwest = { version = "0.11.10", features = ["json"] }
rocket = { version = "0.5.0-rc.3", features = ["json"] }
rocket = { version = "0.5.0-rc.2", features = ["json"] }
rocket_dyn_templates = { version = "0.1.0-rc.2", features = ["tera"] }
rss = "2.0.1"
thiserror = "1.0.31"
url = { version = "2.2.2", features = ["serde"] }
youtube_dl = { version = "0.8.0", features = ["tokio"] }
ytextract = "0.11.2"
youtube_dl = { version = "0.7.0", features = ["tokio"] }
ytextract = "0.11.1"
[package.metadata.deb]
maintainer = "Paul van Tilburg <paul@luon.net>"

View File

@ -65,7 +65,7 @@ provide the limit in the URL by setting the `limit` parameter.
For example, to get up until 1000 items the URL becomes:
```text
https://my.domain.tld/podbringer/feed/mixcloud/myfavouriteband?limit=1000
https://my.domain.tld/podbringer/feed/mixcloud/myfavouriteband?limit=1000`
```
### Service: Mixcloud

View File

@ -182,13 +182,10 @@ impl From<YouTubeVideoWithStream> for Item {
) -> Self {
let id = video.id().to_string();
// Strip parameters from MIME type; some clients are scared of them and they are no
// necessary.
let mut mime_type = stream.mime_type().to_string();
if let Some(sep_idx) = mime_type.find(';') {
mime_type.truncate(sep_idx);
}
let extension = mime_db::extension(&mime_type).unwrap_or_default();
let mime_type = stream.mime_type().to_string();
// Ignore everything from MIME type parameter seperator on for extension look-up.
let mime_sep = mime_type.find(';').unwrap_or(mime_type.len());
let extension = mime_db::extension(&mime_type[..mime_sep]).unwrap_or_default();
let file = PathBuf::from(&id).with_extension(extension);
let enclosure = Enclosure {
file,
@ -308,9 +305,7 @@ async fn fetch_stream(
.streams()
.await
.ok()?
// Select the well-supported, almost always available MP4 container format with
// only an audio stream and then the one with the highest bitrate.
.filter(|v| v.is_audio() && v.mime_type().contains("mp4"))
.filter(|v| v.is_audio())
.max_by_key(|v| v.bitrate())?;
let content_length = stream.content_length().await.ok()?;
@ -339,9 +334,7 @@ async fn retrieve_redirect_url(client: &Client, video_id: &str) -> Result<String
let stream = video
.streams()
.await?
// Select the well-supported, almost always available MP4 container format with only an
// audio stream and then the one with the highest bitrate.
.filter(|v| v.is_audio() && v.mime_type().contains("mp4"))
.filter(|v| v.is_audio())
.max_by_key(|v| v.bitrate())
.ok_or(Error::NoRedirectUrlFound)?;