phpBB Media Embed PlugIn

Apple Music? - phpBB Media Embed PlugIn

Apple Music?

by halil16 » Thu Jul 06, 2023 10:13 am

Hello, is it possible to add Apple Music? I tried a little but couldn't. Can you help me?
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1453
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Apple Music?

by rxu » Fri Jul 07, 2023 6:28 am

How do the links may look like? Is this example the only link type?

Code: Select all

https://music.apple.com/us/album/cruel-summer/1468058165?i=1468058171
Last edited by rxu on Fri Jul 07, 2023 12:28 pm
rxu
Extensions Development Team
Posts: 3966
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: Apple Music?

by halil16 » Fri Jul 07, 2023 6:34 am

rxu wrote:How do the links may look like?
1)

Code: Select all

https://music.apple.com/tr/album/sadem/1071525189?i=1071525285&l=tr
2)

Code: Select all

https://geo.music.apple.com/tr/album/sadem/1071525189?i=1071525285&itsct=music_box_link&itscg=30200&at=xxx&ct=xxx&ls=1&app=music
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1453
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Apple Music?

by rxu » Fri Jul 07, 2023 12:18 pm

Not sure if it's going to work correctly for all cases though.

applemusic.zip
(365 Bytes) Downloaded 12 times
rxu
Extensions Development Team
Posts: 3966
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: Apple Music?

by halil16 » Fri Jul 07, 2023 7:58 pm

It's working. Thank you very much. Good luck to you.

I want to report something: When Spotify is added, there is a big gap under it? Does it happen to you too?


Ekran görüntüsü 2023-07-07 225448.jpg
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1453
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Apple Music?

by halil16 » Fri Jul 07, 2023 10:49 pm

Sorry, I missed something. We only did this for the songs, but the language and height of the albums are different. Worked on it, I did this for albums:

Code: Select all

name: "Apple Music Albums"
host: music.apple.com
example: https://music.apple.com/tr/album/içimdeki-duman/1071525189?l=tr
extract:
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'name'[^/]+)/(?'aid'\\d+)!"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'name'[^/]+)/(?'aid'\\d+)!"
iframe:
    width: "100%"
    height: "450"
    src: //embed.music.apple.com/{@country}/album/{@name}/{@aid}?app=music&itsct=music_box_player&itscg=30200&at=xxxxxx&ct=ob-topic&ls=1&theme=auto
First I tried with the same file but it didn't work. Both do not work together in different file, only album is taken into account. Is there a way to combine them or run them in separate files?
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1453
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Apple Music?

by halil16 » Sat Jul 08, 2023 12:11 am

I discovered another problem. If there is a character other than English, it does not work when converted to this URL structure.

Code: Select all

https://music.apple.com/tr/album/i-ncir-feat-enbe-orkestras%C4%B1/1071525189?i=1071525301
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1453
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Apple Music?

by rxu » Sat Jul 08, 2023 5:11 am

For now it looks like that.

Code: Select all

name: "Apple Music"
host: music.apple.com
example: https://music.apple.com/tr/album/sadem/1071525189?i=1071525285&l=tr
extract:
    - "!//music.apple.com/(?'country'[a-z]{2})/playlist/(?'plname'[\\w\\d\\-%A-F]+)/(?'plid'pl\\.[\\w\\d]+)!"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\w\\d\\-%A-F]+)/(?'aid'\\d+)!"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\w\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\w\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!"
choose:
    when:
        test: '@plid'
        iframe:
            width: "100%"
            src: //embed.music.apple.com/{@country}/playlist/{@plname}/{@plid}
    otherwise:
        choose:
            when:
                test: '@tid'
                iframe:
                    width: "100%"
                    height: "150"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}?i={@tid}&l={@country}
            otherwise:
                iframe:
                    width: "100%"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}

Last edited by rxu on Sat Jul 08, 2023 3:59 pm
rxu
Extensions Development Team
Posts: 3966
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: Apple Music?

by halil16 » Sat Jul 08, 2023 11:45 am

Perfect. But some correction:

Code: Select all

name: "Apple Music"
host: music.apple.com
example: https://music.apple.com/tr/album/sadem/1071525189?i=1071525285&l=tr
extract:
    - "!//music.apple.com/(?'country'[a-z]{2})/playlist/(?'plname'[\\w\\d\\-%A-F]+)/(?'plid'pl\\.[\\w\\d]+)!"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\w\\d\\-%A-F]+)/(?'aid'\\d+)!"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\w\\d\\-%A-F]+)/(?'aid'\\d+\\?i\\=)(?'tid'\\d+)!"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\w\\d\\-%A-F]+)/(?'aid'\\d+\\?i\\=)(?'tid'\\d+)!"
choose:
    when:
        test: '@plid'
        iframe:
            width: "100%"
            height: "450"
            src: //embed.music.apple.com/{@country}/playlist/{@plname}/{@plid}
    otherwise:
        choose:
            when:
                test: '@tid'
                iframe:
                    width: "100%"
                    height: "175"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}?i={@tid}&l={@country}
            otherwise:
                iframe:
                    width: "100%"
                    height: "450"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}
Thank you very much.
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1453
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Apple Music?

by rxu » Sat Jul 08, 2023 4:00 pm

Corrected 2 lines

Code: Select all

    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\w\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\w\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!"
rxu
Extensions Development Team
Posts: 3966
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: Apple Music?

by halil16 » Sat Jul 08, 2023 4:34 pm

Okey, and add this line:

Code: Select all

    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\w\\d\\-%A-F]+)/(?'aid'\\d+)!"
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1453
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Apple Music?

by MattF » Sat Jul 08, 2023 4:45 pm

Change

Code: Select all

- "!//music.apple.com/(?'country'[a-z]{2})/playlist/(?'plname'[\\w\\d\\-%A-F]+)/(?'plid'pl\\.[\\w\\d]+)!"
To

Code: Select all

- "!//music.apple.com/(?'country'[a-z]{2})/playlist/(?'plname'[\\w\\d\\-%A-F]+)/(?'plid'pl\\.[\\w\\d-]+)!"
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 6039
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: Apple Music?

by rxu » Sat Jul 08, 2023 5:25 pm

Applied above fixes + regexes made utf8-compliant (pointed out by JoshyPHP).

Code: Select all

name: "Apple Music"
host: music.apple.com
example: https://music.apple.com/tr/album/sadem/1071525189?i=1071525285&l=tr
extract:
    - "!//music.apple.com/(?'country'[a-z]{2})/playlist/(?'plname'[\\pL\\d\\-%A-F]+)/(?'plid'pl\\.[\\w\\d\\-]+)!u"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)!u"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!u"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!u"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)!u"
choose:
    when:
        test: '@plid'
        iframe:
            width: "100%"
            src: //embed.music.apple.com/{@country}/playlist/{@plname}/{@plid}
    otherwise:
        choose:
            when:
                test: '@tid'
                iframe:
                    width: "100%"
                    height: "150"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}?i={@tid}&l={@country}
            otherwise:
                iframe:
                    width: "100%"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}
rxu
Extensions Development Team
Posts: 3966
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: Apple Music?

by halil16 » Wed Jul 12, 2023 8:26 am

I think it should be like this:

Code: Select all

name: "Apple Music"
host: music.apple.com
example: https://music.apple.com/tr/album/sadem/1071525189?i=1071525285&l=tr
extract:
    - "!//music.apple.com/(?'country'[a-z]{2})/playlist/(?'plname'[\\pL\\d\\-%A-F]+)/(?'plid'pl\\.[\\w\\d\\-]+)!u"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)!u"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!u"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!u"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)!u"
choose:
    when:
        test: '@plid'
        iframe:
            width: "100%"
            height: "450"
            src: //embed.music.apple.com/{@country}/playlist/{@plname}/{@plid}?app=music&itsct=music_box_player&itscg=30200&ls=1&theme=auto
    otherwise:
        choose:
            when:
                test: '@tid'
                iframe:
                    width: "100%"
                    height: "175"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}?i={@tid}&app=music&itsct=music_box_player&itscg=30200&ls=1&theme=auto
            otherwise:
                iframe:
                    width: "100%"
                    height: "450"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}?app=music&itsct=music_box_player&itscg=30200&ls=1&theme=auto
Buy me a coffee ☕
Hire me for your phpBB board. 🚩
Introducing Mobile Upgrade! *Make your phpBB board like an app! 📱
O BeldeThatTowns*for sale*$2250 🛒
"The day we'll need ideas more than possessions, we'll find the secret to true wealth." - Peyami Safa /peˈjɑːmi saˈfɑː/
User avatar
halil16
Registered User
Posts: 1453
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: Apple Music?

by MattF » Wed Jul 12, 2023 2:07 pm

halil16 wrote:I think it should be like this:

Code: Select all

name: "Apple Music"
host: music.apple.com
example: https://music.apple.com/tr/album/sadem/1071525189?i=1071525285&l=tr
extract:
    - "!//music.apple.com/(?'country'[a-z]{2})/playlist/(?'plname'[\\pL\\d\\-%A-F]+)/(?'plid'pl\\.[\\w\\d\\-]+)!u"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)!u"
    - "!//music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!u"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)\\?i\\=(?'tid'\\d+)!u"
    - "!//geo.music.apple.com/(?'country'[a-z]{2})/album/(?'artist'[\\pL\\d\\-%A-F]+)/(?'aid'\\d+)!u"
choose:
    when:
        test: '@plid'
        iframe:
            width: "100%"
            height: "450"
            src: //embed.music.apple.com/{@country}/playlist/{@plname}/{@plid}?app=music&itsct=music_box_player&itscg=30200&ls=1&theme=auto
    otherwise:
        choose:
            when:
                test: '@tid'
                iframe:
                    width: "100%"
                    height: "175"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}?i={@tid}&app=music&itsct=music_box_player&itscg=30200&ls=1&theme=auto
            otherwise:
                iframe:
                    width: "100%"
                    height: "450"
                    src: //embed.music.apple.com/{@country}/album/{@artist}/{@aid}?app=music&itsct=music_box_player&itscg=30200&ls=1&theme=auto
none of your additions are part of Apple Music embed codes in everything I've looked at.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 6039
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman