Seriously-Simple-Podcasting icon indicating copy to clipboard operation
Seriously-Simple-Podcasting copied to clipboard

Should Podcast file URL international text be urlencoded?

Open tkittich opened this issue 5 years ago • 4 comments

Hello,

Thank you for this plugin. It’s the best!! ^^

I’ve run into a problem with Podcast file URLs with international filenames. For example, the mp3 filename is “ชื่อไทย แปลกๆ (เช้า) ๑๒๓.mp3”. Should the international name be urlencoded?

With the URL not urlencoded, eg "http://wordpress.dd/download/ชื่อไทย แปลกๆ (เช้า) ๑๒๓.mp3", things seem to work fine. Most browsers would urlencode international URL automatically. But, Apple iTunes Podcasts Connect would not validate the feed. It would give an error saying “Can’t download episodes from your feed.” .

With the URL urlencoded, eg “http://wordpress.dd/download/%E0%B8%8A%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B9%84%E0%B8%97%E0%B8%A2%20%E0%B9%81%E0%B8%9B%E0%B8%A5%E0%B8%81%E0%B9%86%20(%E0%B9%80%E0%B8%8A%E0%B9%89%E0%B8%B2)%20%E0%B9%91%E0%B9%92%E0%B9%93.mp3”, things seem to work as well. But “File Size” and “Duration” field of the episode edit page doesn’t get updated automatically when the ‘Update’ button is clicked.

So, does SSP expect the Podcast file URL to be urlencoded? If yes, then perhaps the function get_file_size() and get_file_duration() could take an extra step to urldecode the file and directory path to get the file size and duration. If no, then perhaps the feed should automatically urlencode the file and directory path of the enclosure tag.

Note: This is a replicate of a forum post at https://wordpress.org/support/topic/should-podcast-file-url-international-text-be-urlencoded/ .

tkittich avatar Aug 05 '19 15:08 tkittich

Thanks @tkittich

@TheCraigHewitt at the moment, the media file URLs in the RSS feed are not urlencoded. However, urlencoding them might resolve some of the issue's we've seen with non English language characters and podcast feeds not being accepted by Apple Podcasts.

https://www.permadi.com/tutorial/urlEncoding/

Off the top of my head I can't think of any reason not to urlencode the file URLs, are you aware of any?

jonathanbossenger avatar Aug 06 '19 07:08 jonathanbossenger

@jonathanbossenger i would agree that taking the step to encode the media file URLs makes sense and would likely avoid some of the issues that @tkittich is describing. I've seen this firsthand in troubleshooting issues with users in the past, so it's probably worth prioritizing here in the next couple of dev cycles.

TheCraigHewitt avatar Aug 06 '19 15:08 TheCraigHewitt

@TheCraigHewitt thanks. After a quick test yesterday, we should probably only encode the file name itself. If we encode the full file path, it might cause problems with already valid characters in the url (: and //) being double encoded, which is not ideal.

jonathanbossenger avatar Aug 07 '19 06:08 jonathanbossenger

Hello, If you choose to urlencode the media file URL, please encode the directory path as well, e.g. http://wordpress.dd/directory ภาษาอื่นๆ/nested ได้ไหม/ชื่อไทย แปลกๆ (เช้า) ๑๒๓.mp3 .

tkittich avatar Aug 11 '19 05:08 tkittich