Commit graph

1485 commits

Author SHA1 Message Date
Roderick van Domburg
9d88ac59c6
Configure User-Agent once 2021-12-18 13:39:41 +01:00
Roderick van Domburg
3b07a6bcb9
Support user-defined temp directories 2021-12-17 20:58:05 +01:00
Roderick van Domburg
97d4d83b7c
cargo fmt 2021-12-16 23:03:30 +01:00
Roderick van Domburg
82b2653c5f
Merge remote-tracking branch 'librespot-org/dev' into new-api-wip 2021-12-16 23:01:56 +01:00
Roderick van Domburg
e5fd7d6506
Merge pull request #899 from JasonLG1979/arg_parse_fixup
Fix incorrect verbose logging of command line options
2021-12-16 22:49:54 +01:00
Roderick van Domburg
2f7b9863d9
Implement CDN for audio files 2021-12-16 22:42:37 +01:00
Jason Gray
306096ee2a
Merge branch 'librespot-org:dev' into arg_parse_fixup 2021-12-15 12:28:09 -06:00
Roderick van Domburg
24e2c6da25
Merge pull request #907 from tomodachi/arm64
Add arm64 target example
2021-12-15 19:02:14 +01:00
Roderick van Domburg
1736e7c52b
Merge pull request #905 from roderickvd/fix-exit-on-decoder-error
Skip track on decoding error
2021-12-15 19:01:15 +01:00
Roderick van Domburg
1cd5f9e571
Merge pull request #896 from JasonLG1979/dynamic-alsa-buffer
Dynamic failable buffer sizing alsa-backend
2021-12-15 18:52:27 +01:00
JasonLG1979
d5efb8a620 Dynamic failable buffer sizing alsa-backend
Dynamically set the alsa buffer and period based on the device's reported min/max buffer and period sizes. In the event of failure use the device's defaults.

This should have no effect on devices that allow for reasonable buffer and period sizes but would allow us to be more forgiving with less reasonable devices or configurations.

Closes: https://github.com/librespot-org/librespot/issues/895
2021-12-14 16:49:09 -06:00
Mateusz Mojsiejuk
67836b5b02 Added arm64 target to docker run examples. Also removed
feature quotes as they're not nessesary and don't match
the non-quoted examples of targets in the WIKI
2021-12-14 21:23:13 +01:00
JasonLG1979
368bee1088 condense some option parsings 2021-12-13 18:43:28 -06:00
JasonLG1979
d29337c62d Dry up error messages. 2021-12-12 23:25:19 -06:00
Roderick van Domburg
8f23c3498f
Clean up warnings 2021-12-12 20:01:05 +01:00
Roderick van Domburg
79c4040a53
Skip track on decoding error 2021-12-12 12:56:02 +01:00
JasonLG1979
8c480b7e39 Fix Command line arguments incorrectly echoed in TRACE
Fix up for #886
Closes: #898

And...

* Don't silently ignore non-Unicode while parsing env vars.

* Iterating over `std::env::args` will panic! on invalid unicode. Let's not do that. `getopts` will catch missing args and exit if those args are required after our error message about the arg not being valid unicode.

* Gaurd against empty strings. There are a few places while parsing options strings that we don't immediately evaluate their validity let's at least makes sure that they are not empty if present.

* `args` is only used in `get_setup` it doesn't need to be in main.

* Nicer help header.

* Get rid of `use std::io::{stderr, Write};` and just use `rpassword::prompt_password_stderr`.

* Get rid of `get_credentials` it was clunky, ugly and only used once. There is no need for it to be a separate function.

* Handle an empty password prompt and password prompt parsing errors.

* + Other random misc clean ups.
2021-12-11 16:24:09 -06:00
Roderick van Domburg
9a93cca562
Get connection ID 2021-12-11 23:06:58 +01:00
Roderick van Domburg
9a31aa0362
Pretty-print trace messages 2021-12-11 20:45:08 +01:00
Roderick van Domburg
e748d543e9
Check availability from the catalogue attribute 2021-12-11 20:22:44 +01:00
Roderick van Domburg
51b6c46fcd
Receive autoplay and other attributes 2021-12-11 16:43:34 +01:00
Roderick van Domburg
9a0d2390b7
Get user attributes and updates 2021-12-11 00:03:35 +01:00
Roderick van Domburg
40163754bb
Update protobufs to 1.1.73.517 2021-12-10 20:33:43 +01:00
Roderick van Domburg
4f51c1e810
Report actual CPU, OS, platform and librespot version 2021-12-09 19:01:54 +01:00
Roderick van Domburg
f3bb679ab1
Rid of the last remaining clippy warnings 2021-12-08 21:00:42 +01:00
Roderick van Domburg
33620280f5
Fix build on Cargo 1.48 2021-12-08 20:44:48 +01:00
Roderick van Domburg
f74c574c9f
Fix lyrics and add simpler endpoint 2021-12-08 20:27:15 +01:00
Roderick van Domburg
9b2ca1442e
Move FileId out of SpotifyId 2021-12-08 19:53:45 +01:00
Roderick van Domburg
f03a7e95c1
Merge remote-tracking branch 'librespot-org/dev' into new-api-wip 2021-12-08 19:11:53 +01:00
Roderick van Domburg
87f6a78d3e
Fix examples 2021-12-07 23:52:34 +01:00
Roderick van Domburg
0e2686863a
Major metadata refactoring and enhancement
* Expose all fields of recent protobufs

 * Add support for user-scoped playlists, user root playlists and
   playlist annotations

 * Convert messages with the Rust type system

 * Attempt to adhere to embargos (tracks and episodes scheduled for
   future release)

 * Return `Result`s with meaningful errors instead of panicking on
   `unwrap`s

 * Add foundation for future playlist editing

 * Up version in connection handshake to get all version-gated features
2021-12-07 23:22:24 +01:00
Roderick van Domburg
7160dc1017
Merge pull request #897 from JasonLG1979/clippy-lints
Address clippy lint warnings from Rust 1.57
2021-12-03 20:07:56 +01:00
JasonLG1979
4370258716 Address clippy lint warnings for rust 1.57 2021-12-03 12:51:41 -06:00
Jason Gray
e66cc5508c
parse environment variables (#886)
Make librespot able to parse environment variables for options and flags.

To avoid name collisions environment variables must be prepended with `LIBRESPOT_` so option/flag `foo-bar` becomes `LIBRESPOT_FOO_BAR`.

Verbose logging mode (`-v`, `--verbose`) logs all parsed environment variables and command line arguments (credentials are redacted).
2021-12-01 21:29:58 +01:00
Roderick van Domburg
47badd61e0
Update tokio and fix build 2021-11-27 14:26:13 +01:00
Roderick van Domburg
f037a42908
Migrate and expand playlist protos 2021-11-27 11:59:22 +01:00
Roderick van Domburg
a73e05837e
Return HttpClientError for status code <> 200 2021-11-27 10:41:54 +01:00
Roderick van Domburg
e1b273b8a1
Fix lyrics retrieval 2021-11-27 08:30:51 +01:00
Roderick van Domburg
d19fd24074
Add spclient and HTTPS support
* Change metadata to use spclient
 * Add support for HTTPS proxies
 * Start purging unwraps and using Result instead
2021-11-26 23:28:37 +01:00
Nick Botticelli
56585cabb6
Add Google sign in credential to protobufs 2021-11-26 23:28:37 +01:00
Tom Vincent
bbd575ed23
Harden systemd service, update restart policy (#888) 2021-11-26 19:49:50 +01:00
Roderick van Domburg
97399e2c0a
Merge pull request #883 from JasonLG1979/improve_device_list_outputs
Improve `--device ?` functionality for the alsa backend
2021-11-25 09:45:36 +01:00
JasonLG1979
c006a23644 Improve --device ? functionality for the alsa backend
This makes `--device ?` only show compatible devices (ones that support 2 ch 44.1 Interleaved) and it shows what `librespot` format(s) they support.

This should be more useful to users as the info maps directly to `librespot`'s `--device` and `--format` options.
2021-11-20 13:51:24 -06:00
Roderick van Domburg
e064f27c13
Merge pull request #880 from JasonLG1979/fix_index_out_bounds_spirc
Guard against tracks_len being zero
2021-11-19 21:52:39 +01:00
JasonLG1979
3016d6fbdb Guard against tracks_len being zero
to prevent 'index out of bounds: the len is 0 but the index is 0'
https://github.com/librespot-org/librespot/issues/226#issuecomment-971642037
2021-11-17 21:15:35 -06:00
Roderick van Domburg
85d6049ee7
Merge pull request #875 from JasonLG1979/refactor-main
Refactor main.rs
2021-11-17 22:44:22 +01:00
JasonLG1979
0e9fdbe6b4 Refactor main.rs
* Don't panic when parsing options. Instead list valid values and exit.
* Get rid of needless .expect in playback/src/audio_backend/mod.rs.
* Enforce reasonable ranges for option values (breaking).
* Don't evaluate options that would otherwise have no effect.
* Add pub const MIXERS to mixer/mod.rs very similar to the audio_backend's implementation. (non-breaking though)
* Use different option descriptions and error messages based on what backends are enabled at build time.
* Add a -q, --quiet option that changed the logging level to warn.
* Add a short name for every flag and option.
* Note removed options.
* Other misc cleanups.
2021-11-17 15:31:16 -06:00
Roderick van Domburg
45b19efd03
Merge pull request #874 from JasonLG1979/kill-the-undead
Prevent librespot from becoming a zombie
2021-10-30 20:27:42 +02:00
JasonLG1979
24e4d2b636 Prevent librespot from becoming a zombie
Prevent hang when discovery is disabled and there are no credentials or when bad credentials are given.
2021-10-28 09:13:46 -05:00
Roderick van Domburg
5049cd76e0
Merge pull request #872 from JasonLG1979/add-disable-credential-cache-flag
Add disable credential cache flag
2021-10-28 15:18:34 +02:00