El ejemplo de este artículo dice la forma en que Java adquiere el enlace de descarga real del disco de red de Baidu. Compártelo para todos para su referencia. Los detalles son los siguientes:
Todavía hay un problema.
Back <Map <String, Object >> En la devolución incluye: nombre de archivo (nombre del archivo), URL (dirección de cadena real)
Httprequest.java es el siguiente:
Import java.io.bufferedreader; URL; get "); httpurlconnection.setDoInput (true); httpurlconnection.setDoutput (true); inputStream is = http urlconnection.getInputStream (); inputStreamReader isr = new InputStreamReamReamReamer (is); BufferedReader Buffereder = New BufferedReader (ISR)") "" "" "" ;;
Obtener método:
Importar java.net.urlencoder; .Jsoup; Objeto >> list = new ArrayList <map <string, objeto >> (); b = html.indexof ("yundata.getCon"); ("yundata.timestamp = /" "); int time_foot = html.indexof (" yundata.share_uk "); int share_id_head = html.indexof (" yundata. share_id = /""); yundata.sign "); string fir = html.substring (sign_head, sign_foot); sign = sign.substrin. g (sign.indexof ("/"") + 1, sign.indexof ("/"; ")); String Time = html.substring (Time_head, Time_foot); Share_id_foot); b); ); "UTF-8"); getString ("app_id"); "" & shareId = " + shareId +" & num = 100 & dir = " + ruta +" & Order = Time & Desc = 1 & _ = " + Time +" & Bdstoken = C51077CE0E0E0E316066612A13FBCD4 & ClientType = 0 & WEB = 0 & & & Web = 1 & app_id = " + app_id; string fileListjson = httprequest.getData (url1); system.out.println (fileListjson); jsonArray = new JSonArray (" "[" " + fileListjson +"]; jsonObject = jSonArray.getjsonObject (0); > (); = httprequest .getData ("http: // pan. baidu.com/api/shardownload? firme =" + signo + "× tamp =" + time + "& bdstoken = c51077ce0e31316066612a13fbcd4 & chunlei & clientType = 0 & web = 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & APP_ID = 250528 & CiCrypt = 0 & Product = Share & UK = " + UK +" & primarioD = " + share_id +" & fid_list =%5b " + fs_id.get (i) +"%5d "); JSONArray jsonArray2 = new JsonArray ("[" " + FileInfo +"]; getString ("errno") .equals ("0")) {jSonArray2 = new JSonArray (json_data.getString ("list"); json_data = jsonarray2.getJsonObject (0) ; ;} Else {return null;} list.add (map);} Urna List;}}
Se espera que este artículo sea útil para el diseño del programa Java de todos.