Sök i support

Akta dig för supportbedrägerier: Vi kommer aldrig att be dig att ringa eller skicka ett sms till ett telefonnummer eller dela personlig information. Rapportera misstänkt aktivitet med alternativet "Rapportera missbruk".

Läs mer

How to parse the json format data automatically?

  • 2 svar
  • 1 har detta problem
  • 4 visningar
  • Senaste svar av cor-el

more options

when: http://192.168.16.131:6900/query/v1/mp4/11111111111111111111111100000066.json?bits=5024

response: {"return":"succ","client":{"ip":"192.168.131.30","sp":"0","loc":"0"},"playlist":[{"bits":"4060","tname":"super-dvd","size":"90000500","urls":["http://4.2.3.3:60/play/AB00000000000000000000000000000000000107.mp4","http://4.2.3.2:70/play/AB00000000000000000000000000000000000107.mp4"]}]}


and i want :


{

 return: "succ",
 client: {
   ip: "192.168.131.30",
   sp: "0",
   loc: "0"
 },
 playlist: [
   {
     bits: "4060",
     tname: "super-dvd",
     size: "90000500",
     urls: [
       "http://4.2.3.3:60/play/AB00000000000000000000000000000000000107.mp4",
       "http://4.2.3.2:70/play/AB00000000000000000000000000000000000107.mp4"
     ]
   }
 ]

}

when: http://192.168.16.131:6900/query/v1/mp4/11111111111111111111111100000066.json?bits=5024 response: {"return":"succ","client":{"ip":"192.168.131.30","sp":"0","loc":"0"},"playlist":[{"bits":"4060","tname":"super-dvd","size":"90000500","urls":["http://4.2.3.3:60/play/AB00000000000000000000000000000000000107.mp4","http://4.2.3.2:70/play/AB00000000000000000000000000000000000107.mp4"]}]} and i want : { return: "succ", client: { ip: "192.168.131.30", sp: "0", loc: "0" }, playlist: [ { bits: "4060", tname: "super-dvd", size: "90000500", urls: [ "http://4.2.3.3:60/play/AB00000000000000000000000000000000000107.mp4", "http://4.2.3.2:70/play/AB00000000000000000000000000000000000107.mp4" ] } ] }

Alla svar (2)

more options

You're doing this in JavaScript, or just opening it directly in Firefox?

Generally speaking, text files like JSON responses do not have any associated style sheet and Firefox just displays them as received. To pretty it up, you probably need to retrieve it with a script that generates an HTML page from it. Perhaps there is an add-on for that?

more options