Comments (11)
Please feel free to submit a PR to fix this.
from picard-plugins.
If I could code that in Python, I would do that...
from picard-plugins.
The Paper CD case code does not e.g. convert Träne
to Träne
- that appears to be done by the python webbrowser functionality.
If you can provide an example Release MBID then I will see what I can do to fix this.
from picard-plugins.
Actually I don't think that Tr%26auml;ne
will work either as my testing suggests that the ne
gets dropped. Instead based on creating a test using the papercdcase form suggests that it should be Tr%E4ne
.
A look at the code suggests that this is a combination of using QUrl.toString
and webbrowser.open
- perhaps we should be using QUrl.toEncoded
instead.
I will need to run some tests to see what works - please provide an example Album MBID that I can use for testing and I will see what I can do about this.
from picard-plugins.
Also I need to know whether you are using Picard 1.4.x or Picard 2.0.x
from picard-plugins.
I'm using Picard 1.4.2 and an example MBID is: https://musicbrainz.org/release/b5a959e6-8192-42f2-9a8b-ac5393d5c500
If I replace the part &track2=Keni%20Träne%20Meh
in the URL for the above album to &track2=Keni%20Tr%26auml;ne%20Meh
the text "Keni Träne Meh" will bi displayed correctly in the paper cd case-form.
The complete URL actually looks like:
http://papercdcase.com/advanced.php?artist=&title=Unmatched%20Files&track1=Indianer&track2=Keni%20Tr%26auml;ne%20Meh&track3=B%C3%BCetzer&track4=Ohni%20Di&track5=I%20h%C3%A4t%20No%20Viu%20bl%C3%B6der%20Ta&track6=Vatter&track7=Uf%20U%20Dervo&track8=Hingedri&track9=Schwan&track10=Grossp%C3%A8re&track11=Fl%C3%BCgu&track12=Zyt%20Zum%20Danke
The original URL is converted here on GitHub automatically (using Google Chrome on Windows 10). The vowels are directly visible as ä ö ü and not as %C3%A4 or %C3%B6
....&track3=Büetzer&track4=Ohni%20Di&track5=I%20hät%20No%20Viu%20blöder%20Ta....
from picard-plugins.
I am sure I tested this back then, but might be I could not fine a solution. The HTML escpaing trick works, even if it is pretty unusual. But papercdcase just cannot deal with Unicode values passed in the URL, and as long as this workaround does the trick we should use it. Thanks for finding this.
Just have to figure out how to most elegantly do the HTML conversion. Unfortunately Python's html.escpape
is of no use here since it only escapes the absolutely necessary (&, <, >)
I used this for testing: https://musicbrainz.org/release/5f4488c6-fc10-4129-b319-63c86754efa0
Actually I don't think that Tr%26auml;ne will work either as my testing suggests that the ne gets dropped. Instead based on creating a test using the papercdcase form suggests that it should be Tr%E4ne.
The HTML entity approach worked for me. While %E4
would also work, this involves encoding the string to ISO-8859-1, as this is the encoding the site uses. But with the HTML entitiy approach you can also pass characters outside of this encdoing, e.g. this works for passing Japanese characters: http://papercdcase.com/advanced.php?artist=%26%23x65E5;%26%23x672C;%26%23x8A9E;
from picard-plugins.
I have made several attempts to find a way of making this work and failed completely.
urllib.urlencode
or urllib.quote_plus
just crash the plugin without an error message, and cgi.escape
doesn't handle any but the most basic HTML entities.
Sorry.
from picard-plugins.
So I added some code to handle this, see #149 and #150 . I went with the urlencode instead, that's cleaner. Passing HTML entities is actually abusing an existing HTML injection vulnerability :(
Works for me for the iso-8859-1 encoding range. I also tried to get CJK working, but could not yet figure out what papercdcase.com expects here. It is really a shame it doesn't support Unicode.
from picard-plugins.
Your plugin works now great with vowels. Thank you for that quick fix, @phw
from picard-plugins.
@PeterCodar Glad to hear it works :) I have updated the plugin to deal with a few more characters that could break the URL, so best you update again.
from picard-plugins.
Related Issues (20)
- Error with picard 2.2 and classical extras plugin 2.0.6
- Cue generator include filename
- Fixes for "Generate M3U playlist" HOT 1
- tracks2clipboard should consider disc number
- ValueError Exception in Format Performer Tags HOT 3
- Format performsers splits "lead vocals" into "lead" and "vocals". HOT 2
- Classic Extra (2.0.7) error with Picard 2.3.2 HOT 6
- AcousticBrainz Mood-Genre plugin should have a settings-page like the last-fm plugin HOT 2
- Add Cluster As Release: Adds only one track of the cluster, and in wrong MBS language HOT 6
- [acousticbrainz_tonal-rhythm] Rate limit issues HOT 2
- [moodbars] Treat moodbars as a new type of coverart
- Album Artist Website cannot handle multiple websites HOT 2
- Suggestion Youtube_plugin
- Plugin to copy tags between tracks HOT 4
- Additional settings for "AcousticBrainz tags"
- Cannot install Classical Music Extras HOT 5
- Work HOT 1
- [Proposal] New Backend for ReplayGain Plugin HOT 10
- Replaygain 2.0 only usable in "releases" pane HOT 3
- [abbreviate_artistsort] exception when artist sorted name has no last name part HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from picard-plugins.