islamic-network / api.alquran.cloud

The AlQuran.Cloud API - https://alquran.cloud/api
GNU General Public License v3.0
226 stars 41 forks source link

Expressive meta tags for better titles, and performers of audio files #55

Closed Sherbeeny closed 2 years ago

Sherbeeny commented 2 years ago

When a chatbot sends audio files on telegram by URL, it's not possible to edit file name, audio title, or performer. So, for most files, users get audio files with names of numbers they don't understand, not titles and rarely a performer.

image

It would be great if all audio files have a unified name formats and meta tags.

Something like this: Filename: s001a255Minshawi.mp3 Title: 1.255 Performer: M. Siddiq Minshawi

meezaan commented 2 years ago

The meta tags can be updated, but the filename will not be possible. It would effectively mean duplicating all the files, the URL itself is expressive, although I understand that Telegram doesn't care about the URL.

So, meta tags to be updated.

meezaan commented 2 years ago

@Sherbeeny Al Salaamu Alaykum.

This is now done. The title and artist ID3 tags have been updated on all the files.

I will close the issue, but please feel free to reopen if you don't see the changes.

Sherbeeny commented 2 years ago

Some files of Reciter "Muhammad Ayyoub" are not updated with the new meta tags.

Here's a couple I found: image

I hope there's an easy way for you to recheck/reupdate all the files of all reciters because there might be others.

Jazak Allah khayran

meezaan commented 2 years ago

Thank you. I'll have a look. There's a good chance they are all done but you may just have some caching in place. For starters, I will check the files you have identified and we can see what needs to happen from there.

meezaan commented 2 years ago

I had a look at 3980.mp3. It appears to have all the meta tags.

Can you please share the response headers so I can see which CDN PoP you are hitting, and I can check the caching over there specifically.

Sherbeeny commented 2 years ago

Sorry for my late reply.

Seems that Telegram usually gets response from London.

Here's a log for a file that has Title and Performer: Audio URL header: {"content-type":"audio/mpeg","content-length":"64353","connection":"close","server":"nginx","date":"Wed, 15 Dec 2021 16:43:49 GMT","last-modified":"Thu, 11 Nov 2021 11:02:22 GMT","x-rgw-object-type":"Normal","etag":"\"2de96efd85a6537cd1df5711b8a19407\"","x-amz-meta-s3cmd-attrs":"atime:1636410823/ctime:1635900646/gid:0/gname:root/md5:2de96efd85a6537cd1df5711b8a19407/mode:33188/mtime:1635900646/uid:0/uname:root","cache-control":"public, max-age=2628000","expires":"access plus 30 days","x-amz-storage-class":"STANDARD","x-amz-request-id":"tx00000000000000e5e6e0b-0061ba1b45-26ae983-default","x-proxy-cache":"MISS","x-cdn-pop":"London","x-cdn-provider":"Islamic Network","accept-ranges":"bytes","x-kong-upstream-latency":"49","x-kong-proxy-latency":"0","via":"kong/2.3.3"} 2021-12-15T16:43:50.188515+00:00 app[web.1]: Audio File ctx: {"message_id":1051,"from":{"id":1906112439,"is_bot":true,"first_name":"DailyAyaStaging","username":"DailyAyaStagingBot"},"chat":{"id":589683206,"first_name":"M. Sherbeeny","username":"sherbeeny","type":"private"},"date":1639586630,"audio":{"duration":7,"file_name":"5667.mp3","mime_type":"audio/mpeg","title":"Al-Mursalaat, Ayah 45 (77:45)","performer":"Muhammad Ayyoub","file_id":"CQACAgQAAxkDAAIEG2G6G0bdGCpQgZsX9tyLPfV-uPnFAALVAgACV1HdUfqKYCV2H3fVIwQ","file_unique_id":"AgAD1QIAAldR3VE","file_size":64353},"caption":"@DailyAyaStagingBot","caption_entities":[{"offset":0,"length":19,"type":"text_link","url":"http://t.me/DailyAyaStagingBot?start=77-45"}]}

And this file does NOT have a Title or Performer: Audio URL header: {"content-type":"audio/mpeg","content-length":"472694","connection":"close","server":"nginx","date":"Wed, 15 Dec 2021 16:44:03 GMT","last-modified":"Thu, 11 Nov 2021 10:47:52 GMT","x-rgw-object-type":"Normal","etag":"\"69e71d30c4e84ebb0d06680d9a993e73\"","x-amz-meta-s3cmd-attrs":"atime:1636409434/ctime:1635900480/gid:0/gname:root/md5:69e71d30c4e84ebb0d06680d9a993e73/mode:33188/mtime:1635900480/uid:0/uname:root","cache-control":"public, max-age=2628000","expires":"access plus 30 days","x-amz-storage-class":"STANDARD","x-amz-request-id":"tx000000000000014180957-0061ba1b53-25ad226-default","x-proxy-cache":"MISS","x-cdn-pop":"London","x-cdn-provider":"Islamic Network","accept-ranges":"bytes","x-kong-upstream-latency":"58","x-kong-proxy-latency":"1","via":"kong/2.3.3"} 2021-12-15T16:44:03.406227+00:00 app[web.1]: Audio File ctx: {"message_id":1053,"from":{"id":1906112439,"is_bot":true,"first_name":"DailyAyaStaging","username":"DailyAyaStagingBot"},"chat":{"id":589683206,"first_name":"M. Sherbeeny","username":"sherbeeny","type":"private"},"date":1639586643,"audio":{"duration":59,"file_name":"1723.mp3","mime_type":"audio/mpeg","file_id":"CQACAgQAAxkDAAIEHWG6G1NZZyn5V9Quxv6yTyFR1hbLAALHAgACjf9VUp22IaTP73jFIwQ","file_unique_id":"AgADxwIAAo3_VVI","file_size":472292},"caption":"@DailyAyaStagingBot","caption_entities":[{"offset":0,"length":19,"type":"text_link","url":"http://t.me/DailyAyaStagingBot?start=13-16"}]}