[radio] [bandcamp] XPathNotFound('Unable to find element //meta[@itemprop="duration"]')

This is a template for submitting an issue, fill the blanks and remove non-applicable stuff.

First, read the frequently asked questions.

With which module do you encounter problems?

Describe the problem you encounter

Paste here the stacktrace or error message you observe

2025-05-01 14:23:25,735:WARNING:woob.backend.bandcamp.browser.trackpage.get_track:3.7:elements.py:499:handle_attr Attribute duration (in /home/snip/.local/share/woob/modules/3.7/woob_modules/bandcamp/pages.py:140) raises XPathNotFound('Unable to find element //meta[@itemprop="duration"]')
Bug(bandcamp): Unable to find element //meta[@itemprop="duration"]

What are the steps to reproduce the problem?

woob radio

> search song "grow tank"

What woob version are you using?

Output of woob config --version command:

Woob config v3.7 Copyright(C) 2010-2025 Christophe Benz, Romain Bignon

What module version are you using?

Output of woob config info MODULE_NAME command:

.------------------------------------------------------------------------------.
| Module bandcamp                                                              |
+-----------------.------------------------------------------------------------'
| Version         | 202502281228
| Maintainer      | Vincent A <dev@indigo.re>
| License         | AGPLv3+
| Description     | Bandcamp music website
| Capabilities    | CapAudio, CapFile
| Installed       | yes
| Location        | https://updates.woob.tech/3/main/bandcamp.tar.gz
'-----------------'

How did you install woob?

pipx

Additional info you'd like to mention

It looks like the 'duration' is now buried within a json blob on the track page:

    <script type="application/ld+json">
        {"@type":"MusicRecording","@id":"https://currentvalue.bandcamp.com/track/grow-tank","additionalProperty":[{"@type":"PropertyValue","name":"track_id","value":1508851459},{"@type":"PropertyValue","name":"art_id","value":942775972},{"@type":"PropertyValue","name":"license_name","value":"all_rights_reserved"},{"@type":"PropertyValue","name":"tracknum","value":2}],"name":"Grow Tank","isrcCode":"DGA062479790","duration":"P00H04M49S","dateModified":"23 Aug 2024 08:46:20 GMT","datePublished":"09 Aug 2024 00:00:00 GMT","inAlbum":{"@type":"MusicAlbum","name":"Untold / Grow Tank","albumRelease":[{"@type":"MusicRelease","@id":"https://currentvalue.bandcamp.com/album/untold-grow-tank","additionalProperty":[{"@type":"PropertyValue","name":"item_type","value":"a"}]},{"@type":["MusicRelease","Product"],"@id":"https://currentvalue.bandcamp.com/track/grow-tank","name":"Grow Tank","additionalProperty":[{"@type":"PropertyValue","name":"item_id","value":1508851459},{"@type":"PropertyValue","name":"item_type","value":"t"},{"@type":"PropertyValue","name":"selling_band_id","value":2365513580},{"@type":"PropertyValue","name":"type_name","value":"Digital"},{"@type":"PropertyValue","name":"art_id","value":942775972}],"description":"Includes high-quality download in MP3, FLAC and more. Paying supporters also get unlimited streaming via the free Bandcamp app.","offers":{"@type":"Offer","url":"https://currentvalue.bandcamp.com/track/grow-tank#t1508851459-buy","priceCurrency":"EUR","price":1.5,"priceSpecification":{"minPrice":1.5},"availability":"OnlineOnly"},"musicReleaseFormat":"DigitalFormat","image":["https://f4.bcbits.com/img/a0942775972_10.jpg"],"recordLabel":{"@type":"MusicGroup","name":"Blackout Music","@id":"https://blackoutmusic.bandcamp.com","additionalProperty":[{"@type":"PropertyValue","name":"url_suffix","value":"?from=btl"}]}}],"albumReleaseType":"SingleRelease","@id":"https://currentvalue.bandcamp.com/album/untold-grow-tank","additionalProperty":[{"@type":"PropertyValue","name":"download_pref","value":2}]},"byArtist":{"@type":"MusicGroup","name":"Current Value","@id":"https://currentvalue.bandcamp.com"},"publisher":{"@type":"MusicGroup","@id":"https://currentvalue.bandcamp.com","name":"Current Value","additionalProperty":[{"@type":"PropertyValue","name":"band_id","value":735904870},{"@type":"PropertyValue","name":"has_any_downloads","value":true},{"@type":"PropertyValue","name":"has_download_codes","value":true},{"@type":"PropertyValue","name":"image_height","value":6016},{"@type":"PropertyValue","name":"image_id","value":19264193},{"@type":"PropertyValue","name":"image_width","value":4016}],"image":"https://f4.bcbits.com/img/0019264193_10.jpg","genre":"https://bandcamp.com/discover/electronic","subjectOf":[{"@type":"WebPage","url":"https://currentvalue.bandcamp.com/music","name":"music","additionalProperty":[{"@type":"PropertyValue","name":"nav_type","value":"m"}]},{"@type":"WebPage","url":"https://currentvalue.bandcamp.com/community","name":"community","additionalProperty":[{"@type":"PropertyValue","name":"nav_type","value":"c"}]}],"foundingLocation":{"@type":"Place","name":"Berlin, Germany"}},"copyrightNotice":"All Rights Reserved","keywords":["Electronic","drum&bass","Berlin"],"image":"https://f4.bcbits.com/img/a0942775972_10.jpg","sponsor":[{"@type":"Person","url":"https://bandcamp.com/anita_ani_ta","image":"https://f4.bcbits.com/img/0029212735_50.jpg","additionalProperty":[{"@type":"PropertyValue","name":"image_id","value":29212735}],"name":"Anita Junglist"},{"@type":"Person","url":"https://bandcamp.com/zkarcher","image":"https://f4.bcbits.com/img/0017788004_50.jpg","additionalProperty":[{"@type":"PropertyValue","name":"image_id","value":17788004}],"name":"zkarcher"},{"@type":"Person","url":"https://bandcamp.com/thehouseofmontague","image":"https://f4.bcbits.com/img/0039281721_50.jpg","additionalProperty":[{"@type":"PropertyValue","name":"image_id","value":39281721}],"name":"ŤĤẸĤỖǗŜẸỖƑϻỖŇŤÃĞǗẸ"},{"@type":"Person","url":"https://bandcamp.com/hast68","image":"https://f4.bcbits.com/img/0037845904_50.jpg","additionalProperty":[{"@type":"PropertyValue","name":"image_id","value":37845904}],"name":"hast68"}],"mainEntityOfPage":"https://currentvalue.bandcamp.com/track/grow-tank","@context":"https://schema.org"}
    </script>

notably:

"duration":"P00H04M49S"

I attempted to fix this myself but I got stuck trying to figure out how to get a result from an Xpath query as a string 😅