From e1eed89e03c0aadbd6c7781ce680768a16be7c03 Mon Sep 17 00:00:00 2001 From: Michał Cichoń Date: Thu, 18 May 2017 18:16:20 +0200 Subject: Handle escaped authority url components. pianobar-windows-binaries/#3 Authority username and password now can be escaped to handle special characters. --- src/http/http.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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); } } -- cgit v1.2.3 From a05da504f94ca481e9e6f88c38185cbd18b3efd0 Mon Sep 17 00:00:00 2001 From: Michał Cichoń Date: Wed, 17 May 2017 00:22:27 +0200 Subject: Add release content. --- pianobar.cfg.example | 31 +++++++++++++++++++++++++++++++ release/README.md | 34 ++++++++++++++++++++++++++++++++++ release/pianobar.cfg.example | 31 +++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 pianobar.cfg.example create mode 100644 release/README.md create mode 100644 release/pianobar.cfg.example 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://:@: + +user = +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://:@: + +user = +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 -- cgit v1.2.3 From ff34cb46e2002978fa6a41eefaca12484fe6de12 Mon Sep 17 00:00:00 2001 From: Michał Cichoń Date: Wed, 17 May 2017 00:22:51 +0200 Subject: Add screenshot. --- screenshots/pianobar.png | Bin 0 -> 46647 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 screenshots/pianobar.png diff --git a/screenshots/pianobar.png b/screenshots/pianobar.png new file mode 100644 index 0000000..61096ab Binary files /dev/null and b/screenshots/pianobar.png differ -- cgit v1.2.3 From 6615f72c66fba59ffe8b924189d0febab0697923 Mon Sep 17 00:00:00 2001 From: Michał Cichoń Date: Wed, 17 May 2017 01:52:12 +0200 Subject: Add AppVeyor configuration. --- appveyor.yml | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 appveyor.yml 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 -- cgit v1.2.3 From 7b7c9efa8f29fe5667c3e630ccc9599ca27d1371 Mon Sep 17 00:00:00 2001 From: Michał Cichoń Date: Wed, 17 May 2017 02:33:53 +0200 Subject: Update README.md --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 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. -- cgit v1.2.3 From 593b2d6f18eb21309b82f7cad4a56f7bb1218180 Mon Sep 17 00:00:00 2001 From: Michał Cichoń Date: Thu, 18 May 2017 18:25:05 +0200 Subject: Bump version to 2017.05.18 --- src/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" -- cgit v1.2.3