gpt4 book ai didi

javascript - 如何在给定专辑的情况下生成 Bandcamp 播放器嵌入代码?

转载 作者:行者123 更新时间:2023-12-05 00:33:55 25 4
gpt4 key购买 nike

给定 Bandcamp 上专辑的链接,我如何生成代码以嵌入相应的 Bandcamp 播放器? Bandcamp 提供的嵌入代码似乎包含不透明的专辑 ID,我无法以编程方式获取。

最佳答案

Bandcamp 专辑页面的 HTML 源代码在 <script> 部分中包含一个 <head> 标记,该标记具有一个 JSON 对象,其中包含构建嵌入式 Web 播放器的所有必要信息。
例如,https://muvaofearth.bandcamp.com/album/high 包含以下内容:

<script type="application/ld+json">
{"byArtist":{"@type":"MusicGroup","name":"muva of Earth","@id":"https://muvaofearth.bandcamp.com"},"albumReleaseType":"SingleRelease","numTracks":1,"name":"High","@type":"MusicAlbum","copyrightNotice":"All Rights Reserved","keywords":["Alternative","Neo-Soul","afro","alternative","nu-jazz","soul","London"],"publisher":{"event":[{"startDate":"06 Aug 2022 00:00:00 GMT","location":{"name":"Foyer, Queen Elizabeth Hall","@type":"MusicVenue","address":"London, UK"},"@type":"MusicEvent","name":"muva of Earth","url":"https://www.songkick.com/concerts/40422319-pink-siifu-at-foyer-queen-elizabeth-hall?utm_source=1471&utm_medium=partner"},{"startDate":"13 Aug 2022 00:00:00 GMT","location":{"name":"Crystal Palace Bowl","@type":"MusicVenue","address":"Bromley, UK"},"@type":"MusicEvent","name":"muva of Earth","url":"https://www.songkick.com/concerts/40264294-kamasi-washington-at-crystal-palace-bowl?utm_source=1471&utm_medium=partner"},{"startDate":"17 Nov 2022 00:00:00 GMT","location":{"name":"The Lower Third","@type":"MusicVenue","address":"London, UK"},"@type":"MusicEvent","name":"muva of Earth","url":"https://www.songkick.com/concerts/40563917-muva-of-earth-at-lower-third?utm_source=1471&utm_medium=partner"}],"genre":"https://bandcamp.com/tag/alternative","@type":"MusicGroup","name":"muva of Earth","foundingLocation":{"@type":"Place","name":"London, UK"},"@id":"https://muvaofearth.bandcamp.com","image":"https://f4.bcbits.com/img/0029361084_10.jpg","additionalProperty":[{"value":3580433718,"name":"band_id","@type":"PropertyValue"},{"value":"GBP","name":"currency","@type":"PropertyValue"},{"value":true,"name":"has_any_downloads","@type":"PropertyValue"},{"value":true,"name":"has_download_codes","@type":"PropertyValue"},{"value":4096,"name":"image_height","@type":"PropertyValue"},{"value":29361084,"name":"image_id","@type":"PropertyValue"},{"value":3072,"name":"image_width","@type":"PropertyValue"}],"subjectOf":[{"@type":"WebPage","name":"music","url":"https://muvaofearth.bandcamp.com/music","additionalProperty":[{"value":"m","name":"nav_type","@type":"PropertyValue"}]},{"@type":"WebPage","name":"community","url":"https://muvaofearth.bandcamp.com/community","additionalProperty":[{"value":"c","name":"nav_type","@type":"PropertyValue"}]}],"description":"muva of Earth is an alternative jazz singer and ASCENDING SOULSTRESS from tribe ‘Crown of Ọṣun’ in Yorubaland, Nigeria. \nBorn and raised in London, today the ever-evolving being is inspired by Sun Ra, Sade and Fela Kuti. By connecting to her roots, muva of Earth’s music explores the complexities of identity, the self and human connections over a bed of afrofuturistic rhythms and atmospheric horns","mainEntityOfPage":[{"@type":"WebPage","name":"Instagram","url":"https://www.instagram.com/muvaofearth/"}]},"@id":"https://muvaofearth.bandcamp.com/album/high","@context":"https://schema.org","additionalProperty":[{"value":3292814127,"name":"art_id","@type":"PropertyValue"},{"value":1,"name":"featured_track_num","@type":"PropertyValue"},{"value":"all_rights_reserved","name":"license_name","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/a3292814127_10.jpg","track":{"itemListElement":[{"position":1,"@type":"ListItem","item":{"copyrightNotice":"All Rights Reserved","name":"High","@type":"MusicRecording","@id":"https://muvaofearth.bandcamp.com/track/high","additionalProperty":[{"value":1973219776,"name":"track_id","@type":"PropertyValue"},{"value":"all_rights_reserved","name":"license_name","@type":"PropertyValue"}],"duration":"P00H02M56S"}}],"@type":"ItemList","numberOfItems":1},"albumRelease":[{"musicReleaseFormat":"DigitalFormat","@type":["MusicRelease","Product"],"name":"High","offers":{"price":0.0,"priceSpecification":{"minPrice":0.0},"priceCurrency":"GBP","@type":"Offer","url":"https://muvaofearth.bandcamp.com/album/high#a3879992644-buy","additionalProperty":[{"value":1000.0,"name":"max_price","@type":"PropertyValue"}],"availability":"OnlineOnly"},"@id":"https://muvaofearth.bandcamp.com/album/high","image":["https://f4.bcbits.com/img/a3292814127_10.jpg"],"additionalProperty":[{"value":3879992644,"name":"item_id","@type":"PropertyValue"},{"value":"a","name":"item_type","@type":"PropertyValue"},{"value":4286003490,"name":"selling_band_id","@type":"PropertyValue"},{"value":"Digital","name":"type_name","@type":"PropertyValue"},{"value":3292814127,"name":"art_id","@type":"PropertyValue"}],"description":"Includes high-quality download in MP3, FLAC and more. Paying supporters also get unlimited streaming via the free Bandcamp app.","recordLabel":{"@type":"MusicGroup","name":"Brownswood Recordings","@id":"https://brownswoodrecordings.bandcamp.com","additionalProperty":[{"value":"/music?from=btl","name":"url_suffix","@type":"PropertyValue"}]},"identifier":"5060180325619"},{"@type":"MusicRelease","@id":"https://muvaofearth.bandcamp.com/track/high"}],"description":"Brownswood Recordings are happy to present our newest family member, muva of Earth, an alternative jazz singer and ASCENDING SOULSTRESS from South East London. Thought-provoking debut single ‘High’ encapsulates a human’s ability to shape, transform and play with their own point of view. For example, reframing nervousness into excitement and making the most out of a negative situation, resulting in a value-creating experience that demonstrates the power of manifestation. ‘High’ by muva of Earth is released on digital format only on Wednesday 27th July 2022 via Brownswood Recordings. \r\n\r\nInspired by the breakdown of a relationship, the track opens with a euphoric harmony, the ethereal vocals are grounded by the chugging Hip Hop drum beat, inviting the listener into muva of Earth’s Afro-spiritual world. The lyrics carry a poignant message, “Thirsting for knowledge, thirsting for thought’ touches upon the purpose of human life on a constant quest for stimulation. “Wondering why people divide” is a reflexive moment pondering existential questions like, why is there so much turmoil in life? The vocals build up to a powerful crescendo elevating the affirmations developed throughout the song, representing an empowering realisation of life as part of a Divine whole to be appreciated and celebrated. \r\n\r\nGrowing up in both London & Kent under the influence of Amy Winehouse and Beyoncé. Moving back to London in her teenage years marks an important moment for muva of Earth as she had the freedom to immerse herself into her music, from studying at college to gracing stages around London with her soulful croons. Today, the ever-evolving being is deeply inspired by Sun Ra, Sade, Alice Coltrane and Fela Kuti. By connecting to her Yoruba roots, muva of Earth’s music explores the complexities of identity, the self and human connections over a bed of afrofuturistic rhythms and atmospheric horns.\r\n\r\nListening to muva of Earth is like planting your feet in rich warm soil; blending spiritual mantras and conscious lyricism, her music is truly transformative.\r\n\r\n‘High’ by muva of Earth is available across all digital streaming platforms on Wednesday July 27th 2022","creditText":"Vocals & Harp performed by muva of Earth \r\nKeyboards, Guitar, Percussion and Programming by Stephen Wesley Holmes\r\nSaxophone by Jaz Lee","dateModified":"28 Jul 2022 11:33:02 GMT","datePublished":"27 Jul 2022 00:00:00 GMT","sponsor":[{"name":"Steve Harrington","@type":"Person","url":"https://bandcamp.com/steveharrington","additionalProperty":[{"value":6141626,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0006141626_50.jpg"},{"name":"detroitlyons1969","@type":"Person","url":"https://bandcamp.com/detroitlyons1969","additionalProperty":[{"value":28555487,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0028555487_50.jpg"},{"name":"SBL Anderson","@type":"Person","url":"https://bandcamp.com/sbl","additionalProperty":[{"value":4524324,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0004524324_50.jpg"},{"name":"mustafa popal","@type":"Person","url":"https://bandcamp.com/mustafapopal","additionalProperty":[{"value":1121612,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0001121612_50.jpg"},{"name":"mxwix","@type":"Person","url":"https://bandcamp.com/ash_hanners","additionalProperty":[{"value":27522757,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0027522757_50.jpg"},{"name":"SHACHO","@type":"Person","url":"https://bandcamp.com/shacho","additionalProperty":[{"value":4216957,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0004216957_50.jpg"},{"name":"lifeboogie","@type":"Person","url":"https://bandcamp.com/lifeboogie","additionalProperty":[{"value":8896602,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0008896602_50.jpg"},{"name":"essarai","@type":"Person","url":"https://bandcamp.com/essarai","additionalProperty":[{"value":3289423,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0003289423_50.jpg"},{"name":"barndog","@type":"Person","url":"https://bandcamp.com/barndog18","additionalProperty":[{"value":27608387,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0027608387_50.jpg"},{"name":"Barry Tucker","@type":"Person","url":"https://bandcamp.com/barrytucker","additionalProperty":[{"value":22231639,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0022231639_50.jpg"},{"name":"Mike Allin","@type":"Person","url":"https://bandcamp.com/mikeallin","additionalProperty":[{"value":24391202,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0024391202_50.jpg"},{"name":"djmeatraffle","@type":"Person","url":"https://bandcamp.com/djmeatraffle","additionalProperty":[{"value":19491106,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0019491106_50.jpg"},{"name":"parjugs","@type":"Person","url":"https://bandcamp.com/parjugs","additionalProperty":[{"value":27516607,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0027516607_50.jpg"},{"name":"naya","@type":"Person","url":"https://bandcamp.com/nayaya","additionalProperty":[{"value":21384901,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0021384901_50.jpg"},{"name":"Hirotaka I'shigaki","@type":"Person","url":"https://bandcamp.com/hirotakaishigaki","additionalProperty":[{"value":5873807,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0005873807_50.jpg"},{"name":"Osunlade","@type":"Person","url":"https://bandcamp.com/osunlade","additionalProperty":[{"value":25094079,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0025094079_50.jpg"},{"name":"cone_the_weird","@type":"Person","url":"https://bandcamp.com/cone_the_weird","additionalProperty":[{"value":14084902,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0014084902_50.jpg"},{"name":"fawces","@type":"Person","url":"https://bandcamp.com/fawces","additionalProperty":[{"value":27693682,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0027693682_50.jpg"},{"name":"Emma Warren","@type":"Person","url":"https://bandcamp.com/emmalwarren","additionalProperty":[{"value":8808049,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0008808049_50.jpg"},{"name":"Kirill Linne","@type":"Person","url":"https://bandcamp.com/linnekirill","additionalProperty":[{"value":21967238,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0021967238_50.jpg"},{"name":"Matthew Slaymaker","@type":"Person","url":"https://bandcamp.com/mattslaymaker","additionalProperty":[{"value":29067867,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0029067867_50.jpg"},{"name":"Carlos Niño Music","@type":"Person","url":"https://bandcamp.com/carlosnino","additionalProperty":[{"value":16650805,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0016650805_50.jpg"},{"name":"Graham Naylor","@type":"Person","url":"https://bandcamp.com/grahamnaylor","additionalProperty":[{"value":4674976,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0004674976_50.jpg"},{"name":"rob ","@type":"Person","url":"https://bandcamp.com/robertgebhard","additionalProperty":[{"value":14401976,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0014401976_50.jpg"},{"name":"thecontinental63","@type":"Person","url":"https://bandcamp.com/thecontinental63","additionalProperty":[{"value":24330960,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0024330960_50.jpg"},{"name":"Aly Gillani","@type":"Person","url":"https://bandcamp.com/alygillani","additionalProperty":[{"value":14569548,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0014569548_50.jpg"},{"name":"craigthomas1","@type":"Person","url":"https://bandcamp.com/craigthomas1","additionalProperty":[{"value":9013630,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0009013630_50.jpg"},{"name":"jjayb","@type":"Person","url":"https://bandcamp.com/jjayb","additionalProperty":[{"value":24156945,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0024156945_50.jpg"},{"name":"New Analog","@type":"Person","url":"https://bandcamp.com/newanalog","additionalProperty":[{"value":28320188,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0028320188_50.jpg"},{"name":"Sadeedo","@type":"Person","url":"https://bandcamp.com/sadeedo","additionalProperty":[{"value":14858237,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0014858237_50.jpg"},{"name":"SoulandJazz","@type":"Person","url":"https://bandcamp.com/marcelvaillant","additionalProperty":[{"value":25086431,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0025086431_50.jpg"},{"name":"ssss","@type":"Person","url":"https://bandcamp.com/samuelmcpherson","additionalProperty":[{"value":29361314,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0029361314_50.jpg"},{"name":"DeLaRoos","@type":"Person","url":"https://bandcamp.com/delaroos","additionalProperty":[{"value":16474284,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0016474284_50.jpg"},{"name":"Tom Turnbull","@type":"Person","url":"https://bandcamp.com/tomturnbull101","additionalProperty":[{"value":10871014,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0010871014_50.jpg"},{"name":"davidgreene1","@type":"Person","url":"https://bandcamp.com/davidgreene1","additionalProperty":[{"value":27367718,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0027367718_50.jpg"},{"name":"gry nicolas","@type":"Person","url":"https://bandcamp.com/grynicolas","additionalProperty":[{"value":8723957,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0008723957_50.jpg"},{"name":"franciscoldn","@type":"Person","url":"https://bandcamp.com/franciscoldn","additionalProperty":[{"value":13492971,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0013492971_50.jpg"},{"name":"david brooks","@type":"Person","url":"https://bandcamp.com/dbrooks46","additionalProperty":[{"value":15934939,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0015934939_50.jpg"},{"name":"Stefan","@type":"Person","url":"https://bandcamp.com/sportivo","additionalProperty":[{"value":17334916,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0017334916_50.jpg"},{"name":"nore01","@type":"Person","url":"https://bandcamp.com/nore01","additionalProperty":[{"value":26186692,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0026186692_50.jpg"},{"name":"Adrian Fox-Pearson","@type":"Person","url":"https://bandcamp.com/adrianfox-pearson","additionalProperty":[{"value":8419619,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0008419619_50.jpg"},{"name":"andychiminea","@type":"Person","url":"https://bandcamp.com/andychiminea","additionalProperty":[{"value":25593828,"name":"image_id","@type":"PropertyValue"}],"image":"https://f4.bcbits.com/img/0025593828_50.jpg"}]}
</script>
您具体需要的是以下键:
  • @id ,即https://muvaofearth.bandcamp.com
  • albumRelease -> additionalProperty -> value 所在对象的name = "item_id",即3879992644
  • 关于javascript - 如何在给定专辑的情况下生成 Bandcamp 播放器嵌入代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42334198/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com