summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md26
-rw-r--r--appveyor.yml79
-rw-r--r--pianobar.cfg.example31
-rw-r--r--release/README.md34
-rw-r--r--release/pianobar.cfg.example31
-rw-r--r--screenshots/pianobar.pngbin0 -> 46647 bytes
-rw-r--r--src/config.h2
-rw-r--r--src/http/http.c28
8 files changed, 218 insertions, 13 deletions
diff --git a/README.md b/README.md
index 16aee6c..20b2638 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,15 @@
-#pianobar
-
pianobar is a console client for the personalized web radio [Pandora]
-([http://www.pandora.com](http://www.pandora.com)).
+([http://www.pandora.com](http://www.pandora.com)) ported to Windows.
+
+![pianobar](https://github.com/thedmd/pianobar-windows/blob/feature/appveyor/screenshots/pianobar.png)
+
+# Releases
+
+Releases can be found at [GitHub Release page](https://github.com/thedmd/pianobar-windows/releases).
+
+[![Build status](https://ci.appveyor.com/api/projects/status/6n5qa9bs7aiy8e52?svg=true)](https://ci.appveyor.com/project/thedmd/pianobar-windows)
-###Features
+### Features
* Play and manage (create, add more music, delete, rename, ...) your stations.
* Rate played songs and let pandora explain why they have been selected.
@@ -12,18 +18,14 @@ pianobar is a console client for the personalized web radio [Pandora]
* last.fm scrobbling support (external application)
* Proxy support for listeners outside the USA.
-###Binary
-
-Prebuild binary is available at [pianobar-windows-binaries](https://github.com/thedmd/pianobar-windows-binaries) repository.
-
-###Source Code
-
-Windows port source code is available at this repository ([pianobar-windows](https://github.com/thedmd/pianobar-windows)).
+### Source Code
Original source code can be downloaded at [github.com](http://github.com/PromyLOPh/pianobar/)
or [6xq.net](http://6xq.net/projects/pianobar/).
-###Building
+### Building
Checkout [pianobar-windows-build](https://github.com/thedmd/pianobar-windows-build) where
you will find configured solution for Visual Studio 2015.
+
+This repository is linked by GitHub submodule.
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..c4f645a
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,79 @@
+version: '{branch}-{build}'
+configuration: Release
+platform:
+- x86
+- x64
+clone_script:
+- ps: >-
+ # Clone build environment
+
+ git clone -q --branch=master https://github.com/thedmd/pianobar-windows-build.git $env:appveyor_build_folder
+
+
+ # Clone project itself
+
+ if(-not $env:appveyor_pull_request_number) {
+ git clone -q --branch=$env:appveyor_repo_branch https://github.com/$env:appveyor_repo_name.git $env:appveyor_build_folder\pianobar\src
+ cd $env:appveyor_build_folder\pianobar\src; git checkout -qf $env:appveyor_repo_commit
+ } else {
+ git clone -q https://github.com/$env:appveyor_repo_name.git $env:appveyor_build_folder\pianobar\src
+ cd $env:appveyor_build_folder\pianobar\src; git fetch -q origin +refs/pull/$env:appveyor_pull_request_number/merge:
+ cd $env:appveyor_build_folder\pianobar\src; git checkout -qf FETCH_HEAD
+ }
+build:
+ verbosity: minimal
+after_build:
+- ps: >-
+ $artifactName = "pianobar"
+
+ if([System.Convert]::ToBoolean($env:appveyor_repo_tag))
+
+ {
+ $artifactName = "$artifactName-$env:appveyor_repo_tag_name"
+ }
+
+ else
+
+ {
+ $branchName = $env:appveyor_build_version -replace "/", "-"
+ $artifactName = "$artifactName-$branchName"
+ }
+
+
+ function Package
+
+ {
+ [cmdletbinding()]
+ Param([string]$BinaryDir, [string]$ArtifactName, [string]$OutputDir, [string]$Suffix)
+ Process
+ {
+ New-Item -ItemType directory $OutputDir\release-$Suffix
+ Copy-Item $env:appveyor_build_folder\pianobar\src\release\* $OutputDir\release-$Suffix
+ Copy-Item $BinaryDir\*.exe $OutputDir\release-$Suffix
+ 7z a $OutputDir\$ArtifactName-$Suffix.zip $OutputDir\release-$Suffix\*
+ }
+ }
+
+
+ if(Test-Path -Path $env:appveyor_build_folder\build\Win32)
+
+ {
+ Package -BinaryDir $env:appveyor_build_folder\build\Win32 -ArtifactName $artifactName -Suffix x86 -OutputDir $env:appveyor_build_folder\build
+ }
+
+
+ if(Test-Path -Path $env:appveyor_build_folder\build\x64)
+
+ {
+ Package -BinaryDir $env:appveyor_build_folder\build\x64 -ArtifactName $artifactName -Suffix x64 -OutputDir $env:appveyor_build_folder\build
+ }
+artifacts:
+- path: build\*.zip
+deploy:
+- provider: GitHub
+ auth_token:
+ secure: bXlXe4mzmi9lpGSfWMvWf01I05hyCuYZAVrlM5ZUad86QfyYvO6EeKTPaCpbjdyp
+ draft: true
+ force_update: true
+ on:
+ branch: /\d\d\d\d\.\d\d.\d\d.*/ \ No newline at end of file
diff --git a/pianobar.cfg.example b/pianobar.cfg.example
new file mode 100644
index 0000000..ed86e88
--- /dev/null
+++ b/pianobar.cfg.example
@@ -0,0 +1,31 @@
+# Uncomment the control_proxy line if you would like to set up a proxy connection for pianobar
+#control_proxy = http://<proxy_user>:<proxy_pass>@<proxy_address>:<proxy_port>
+
+user = <pandora_user>
+password = <pandora_password>
+
+#width = 220
+#height = 60
+
+#-------------------------------------------------------------------------------
+# Uncomment these if you're using GlobalPandora.com
+
+#rpc_host = internal-tuner.pandora.com
+#partner_user = pandora one
+#partner_password = TVCKIBGS9AO9TSYLNNFUML0743LH82D
+#device = D01
+#encrypt_password = 2%3WCL*JU$MP]4
+#decrypt_password = U#IO$RZPAB%VX2
+#tls_fingerprint = B0A1EB460B1B6F33A1B6CB500C6523CB2E6EC946
+
+
+# Messages with colors using terminal escape codes
+format_nowplaying_song = "%t" by "%a" on "%l"%r%@%s
+format_nowplaying_station = Station "%n" (%i)
+format_list_song = %i) %a - %t%r
+format_msg_info = (i) %s
+format_msg_nowplaying = |> %s
+format_msg_time = # %s
+format_msg_err = /!\ %s
+format_msg_question = [?] %s
+format_msg_debug = %s \ No newline at end of file
diff --git a/release/README.md b/release/README.md
new file mode 100644
index 0000000..f98315b
--- /dev/null
+++ b/release/README.md
@@ -0,0 +1,34 @@
+pianobar for Windows - portable binaries
+========
+
+![pianobar](https://github.com/thedmd/pianobar-windows-binaries/blob/master/screenshots/pianobar.png)
+
+pianobar is a console client for the personalized web radio pandora
+(http://www.pandora.com). Source code of the original project can be found at
+at http://github.com/PromyLOPh/pianobar/ or http://6xq.net/projects/pianobar/
+
+This project contains binaries for Windows build using Microsoft
+Visual Studio 2015.
+
+json-c, vtparse are used to prepare this distributtion.
+
+Source code of this binary can be found at:
+https://github.com/thedmd/pianobar-windows-build
+
+
+CONFIGURATION
+
+Pianobar use configuration file. Under Windows this file is named pianobar.cfg
+and should be placed next to pianobar.exe.
+On reporitory there is an example configuration file, you may copy or rename it.
+Then edit it and fill marked fields relevant to you and remove remaining.
+
+Note that non-US users have to have configuration file with control proxy
+details set.
+
+
+GLOBALPANDORA.COM
+
+If you're behind proxy please look into pianobar.cfg.example and copy necessary
+settings to your own configuration file. This are necessary, because
+globalpandora.com does not support server used in by pianobar.
diff --git a/release/pianobar.cfg.example b/release/pianobar.cfg.example
new file mode 100644
index 0000000..ed86e88
--- /dev/null
+++ b/release/pianobar.cfg.example
@@ -0,0 +1,31 @@
+# Uncomment the control_proxy line if you would like to set up a proxy connection for pianobar
+#control_proxy = http://<proxy_user>:<proxy_pass>@<proxy_address>:<proxy_port>
+
+user = <pandora_user>
+password = <pandora_password>
+
+#width = 220
+#height = 60
+
+#-------------------------------------------------------------------------------
+# Uncomment these if you're using GlobalPandora.com
+
+#rpc_host = internal-tuner.pandora.com
+#partner_user = pandora one
+#partner_password = TVCKIBGS9AO9TSYLNNFUML0743LH82D
+#device = D01
+#encrypt_password = 2%3WCL*JU$MP]4
+#decrypt_password = U#IO$RZPAB%VX2
+#tls_fingerprint = B0A1EB460B1B6F33A1B6CB500C6523CB2E6EC946
+
+
+# Messages with colors using terminal escape codes
+format_nowplaying_song = "%t" by "%a" on "%l"%r%@%s
+format_nowplaying_station = Station "%n" (%i)
+format_list_song = %i) %a - %t%r
+format_msg_info = (i) %s
+format_msg_nowplaying = |> %s
+format_msg_time = # %s
+format_msg_err = /!\ %s
+format_msg_question = [?] %s
+format_msg_debug = %s \ No newline at end of file
diff --git a/screenshots/pianobar.png b/screenshots/pianobar.png
new file mode 100644
index 0000000..61096ab
--- /dev/null
+++ b/screenshots/pianobar.png
Binary files differ
diff --git a/src/config.h b/src/config.h
index 8679001..42a0b11 100644
--- a/src/config.h
+++ b/src/config.h
@@ -3,7 +3,7 @@
/* package name */
#define PACKAGE "pianobar"
-#define VERSION "2015.12.10"
+#define VERSION "2017.05.18"
#define TITLE "Pianobar"
diff --git a/src/http/http.c b/src/http/http.c
index 609317f..4576d04 100644
--- a/src/http/http.c
+++ b/src/http/http.c
@@ -250,6 +250,32 @@ bool HttpSetAutoProxy (http_t http, const char* url) {
return false;
}
+static void HttpUrlDecodeInplace (wchar_t* url)
+{
+ wchar_t* input = url;
+ wchar_t* output = url;
+ size_t size = wcslen (url);
+ while (size > 0) {
+ if (input[0] == '%' && iswxdigit(input[1]) && iswxdigit(input[2])) {
+ wchar_t hex[3];
+ hex[0] = input[1];
+ hex[1] = input[2];
+ hex[2] = 0;
+ *output++ = (wchar_t)(wcstol (hex, NULL, 16));
+ input += 3;
+ size -= 3;
+ }
+ else {
+ *output++ = *input++;
+ --size;
+ }
+ }
+
+ if (output < input) {
+ *output = '\0';
+ }
+}
+
bool HttpSetProxy (http_t http, const char* url) {
URL_COMPONENTS urlComponents;
wchar_t* wideUrl = NULL;
@@ -267,10 +293,12 @@ bool HttpSetProxy (http_t http, const char* url) {
if (urlComponents.lpszUserName && urlComponents.dwUserNameLength > 0) {
wideUsername = wcsdup(urlComponents.lpszUserName);
wideUsername[urlComponents.dwUserNameLength] = 0;
+ HttpUrlDecodeInplace (wideUsername);
}
if (urlComponents.lpszPassword && urlComponents.dwPasswordLength > 0) {
widePassword = wcsdup(urlComponents.lpszPassword);
widePassword[urlComponents.dwPasswordLength] = 0;
+ HttpUrlDecodeInplace (widePassword);
}
}