Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xml parsing dont return attribute of tag #60

Closed
arjunmenon opened this issue Jun 6, 2018 · 1 comment
Closed

Xml parsing dont return attribute of tag #60

arjunmenon opened this issue Jun 6, 2018 · 1 comment

Comments

@arjunmenon
Copy link

Hey
I have an XML like this

<DIDL-Lite
	xmlns=\"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/\"
	xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\"
	xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
	xmlns:dlna=\"urn:schemas-dlna-org:metadata-1-0/\"
	xmlns:sec=\"http://www.sec.co.kr/\"
	xmlns:pv=\"http://www.pv.com/pvns/\">
	<item id=\"0/all_tracks/47419\" parentID=\"0/all_tracks\" restricted=\"1\">
		<upnp:class>object.item.audioItem.musicTrack</upnp:class>
		<dc:title>The Local Train - Aaftaab Official Audio</dc:title>
		<dc:creator>&lt;unknown&gt;</dc:creator>
		<upnp:artist>&lt;unknown&gt;</upnp:artist>
		<upnp:albumArtURI>http://192.168.1.2:57745/external/audio/albums/113.jpg</upnp:albumArtURI>
		<upnp:albumArtURI dlna:profileID=\"JPEG_TN\">http://192.168.1.2:57745/external/audio/albums/113.jpg</upnp:albumArtURI>
		<upnp:album>Music</upnp:album>
		<ownerUdn>0ba501af-ad64-abe4-0000-000061ab1285</ownerUdn>
		<res protocolInfo=\"http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000\" size=\"9388725\" duration=\"0:03:54.000\">http://192.168.1.2:57745/external/audio/media/47419.mp3</res>
	</item>
</DIDL-Lite>

When parsing it returns

{"DIDL_Lite"=>
  {"item"=>
    {"upnp:class"=>"object.item.audioItem.musicTrack",
     "dc:title"=>"The Local Train - Aaftaab Official Audio",
     "dc:creator"=>"<unknown>",
     "upnp:artist"=>"<unknown>",
     "upnp:albumArtURI"=>
      ["http://192.168.1.2:57745/external/audio/albums/113.jpg",
       "http://192.168.1.2:57745/external/audio/albums/113.jpg"],
     "upnp:album"=>"Music",
     "ownerUdn"=>"0ba501af-ad64-abe4-0000-000061ab1285",
     "res"=>"http://192.168.1.2:57745/external/audio/media/47419.mp3",
     "id"=>"0/all_tracks/47419",
     "parentID"=>"0/all_tracks",
     "restricted"=>"1"},
   "xmlns"=>"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/",
   "xmlns:upnp"=>"urn:schemas-upnp-org:metadata-1-0/upnp/",
   "xmlns:dc"=>"http://purl.org/dc/elements/1.1/",
   "xmlns:dlna"=>"urn:schemas-dlna-org:metadata-1-0/",
   "xmlns:sec"=>"http://www.sec.co.kr/",
   "xmlns:pv"=>"http://www.pv.com/pvns/"}}

But if you notice the res tag, it is returning only the content which is a URL, but the tag has attributes like protocolinfo, duration, size, etc. I can't get them.

@bf4
Copy link
Collaborator

bf4 commented Oct 30, 2020

Closing as stale.

@bf4 bf4 closed this as completed Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants