Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLencode uploaded file names #28

Open
hubx opened this issue Aug 29, 2013 · 1 comment
Open

URLencode uploaded file names #28

hubx opened this issue Aug 29, 2013 · 1 comment

Comments

@hubx
Copy link
Contributor

hubx commented Aug 29, 2013

File names with Umlauts crash the torrent creation and therefore torrent feed generation.

Traceback (most recent call last):
  File "<console>", line 2, in <module>
  File "/opt/OwnTube/videoportal/models.py", line 190, in create_bittorrent
    make_meta_file(str(self.originalFile.path),
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 43: ordinal not in range(128)

Simple escape ü->ue ... should do the trick.

@hubx
Copy link
Contributor Author

hubx commented Aug 29, 2013

Quickest solution:
cp FileWithUnicode FileEscapedUnicode

$ cp VorstandSüdBB_2013-05-28.flac VorstandSuedBB_2013-05-28.flac

then via python shell

>>> v = Video.objects.filter(title__startswith="Sued VoSi")[0]
>>> v.originalFile
<FieldFile: raw/2013/05/31/VorstandSüdBB_2013-05-28.flac>
>>> v.originalFile.name = 'raw/2013/05/31/VorstandSuedBB_2013-05-28.flac' 
>>> v.create_bittorrent()
>>> v.save()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant