这是一个java写的获取百度网盘真实下载链接进行下载的程序。 
程序里面一些参数拼接是根据浏览器抓包来的。具体的抓包方法网上一大堆,可以参考。这里给出了源码和导出的jar包。 
url网址使用于百度分享的地址。暂时没有适配有提取码的地址。

运行的方法: 
1、在当前的目录打开cmd,默认不带参数就是用默认的测试的url。 
java -jar BaiduPanURL.jar

2、如果想使用自己定义的资源地址可以在后面加一个参数。 
java -jar BaiduPanURL.jar your_url

注意:百度网盘同一个ip进行3次下载之后就需要验证码。程序会在当前的目录生成验证码,输入正确的验证码后可以进行下载。

本人亲测有效,百度会限制下载的速率,测试只有100kb左右。

程序源码: 
1、GetBaiduCloudRealURL:

    package com.example.download;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.HashMap;import java.util.Map;import java.util.regex.Matcher;import java.util.regex.Pattern;import com.example.bean.Response20;import com.example.bean.SetDataBean;import com.google.gson.Gson;/*** 输入百度网盘的资源地址,获取网盘的真实下载地址。* * @author gaoqiang* */public class GetBaiduCloudRealURL {// 定义一些全局变量private static String url = "https://pan.baidu.com/s/1eQrwbKY";// 资源地址private static String cookie = null;private static final String getvcodeURL = "https://pan.baidu.com/api/getvcode?prod=pan";// 请求vcode地址,不变private static boolean isDownload = true;//标记是否需要下载文件,false就只获取地址private static String server_filename = null;private static String size = null;// 通过浏览器抓包分析,获取百度网盘共享文件的真实下载地址public static void main(String[] args) {if (args.length > 0) {System.out.println("输入的原始地址:" + args[0]);url = args[0];}// 第一次获取cookie()Map<String, String> map1 = HttpUtils.get(url, cookie);System.out.println("服务器返回的cookie:\n" + map1.get("cookie") + "\n");cookie = "PANWEB=1;" + map1.get("cookie").split(";")[0];// 抓包看到携带了PANWEB1,不设置也没问题Map<String, String> params = getBodyParams(map1.get("body"));server_filename = params.get("server_filename");size = params.get("size");// 拼接post的url地址String post_url = getPostUrl(params);// 拼接post携带的参数Map<String, String> data = getPostData(params);// 发送post请求String responseJson = HttpUtils.post(post_url, data, cookie);System.out.println(responseJson + "\n");Gson gson = new Gson();Response20 response20 = gson.fromJson(responseJson, Response20.class);String errorCode = response20.getErrno();int count = 0;while (!errorCode.equals("0") && count < 5) {count++;if (errorCode.equals("-20")) {// 下载超过3次,需要验证码,获取vcode和img地址Map<String, String> generateValidateCode = generateValidateCode(count);data.put("vcode_input", generateValidateCode.get("vcode_input"));data.put("vcode_str", generateValidateCode.get("vcode_str"));String responseJsonCode = HttpUtils.post(post_url, data, cookie);System.out.println(responseJsonCode + "\n");errorCode = gson.fromJson(responseJsonCode, Response20.class).getErrno();if (errorCode.equals("0")) {responseJson = responseJsonCode;}}}if (errorCode.equals("0")) {// 成功返回真实的urlString realURL = parseRealDownloadURL(responseJson);System.out.println("成功!真实的下载链接为:" + realURL);if (isDownload) {System.out.println("正在下载文件...");HttpUtils.download(realURL, cookie, server_filename, size);// 进行下载}else{System.out.println("配置不下载");}} else {System.out.println("尝试了" + count + "次,地址获取失败");}}/*** POST请求的url地址*/public static String getPostUrl(Map<String, String> params) {/*** post请求(抓包可看到) 抓包看到logid,实际测试logid不携带也可以正常抓取* https://pan.baidu.com/api/* sharedownload?sign=2d970c761500085deb09d423d549dea2f4ef28da* &timestamp=* 1515400310&bdstoken=null&channel=chunlei&clienttype=0&web=1* &app_id=250528&logid=MTUxNTQwMDQ1NTc1MTAuOTYwMTE4NzIyMzcxMzYwNQ==*/StringBuffer sb1 = new StringBuffer();sb1.append("https://pan.baidu.com/api/sharedownload?");sb1.append("sign=" + params.get("sign"));sb1.append("&timestamp=" + params.get("timestamp"));sb1.append("&bdstoken=" + params.get("bdstoken"));sb1.append("&channel=chunlei");sb1.append("&clienttype=0");sb1.append("&web=1");sb1.append("&app_id=" + params.get("app_id"));String post_url = sb1.toString();System.out.println("POST请求的网址:" + post_url);return post_url;}/*** 获取POST请求携带的参数*/public static Map<String, String> getPostData(Map<String, String> params) {// POST携带的参数(抓包可看到)Map<String, String> data = new HashMap<String, String>();data.put("encrypt", "0");data.put("product", "share");data.put("uk", params.get("uk"));data.put("primaryid", params.get("primaryid"));// 添加了[],解码就是%5B %5Ddata.put("fid_list", "%5B" + params.get("fid_list") + "%5D");data.put("path_list", "");// 可以不写return data;}/*** 从post返回数据解析出dlink字段,真实的下载地址,这个地址有效期8h*/public static String parseRealDownloadURL(String responseJson) {String realURL = "";Pattern pattern = Pattern.compile("\"dlink\":.*?,");Matcher matcher = pattern.matcher(responseJson);if (matcher.find()) {String tmp = matcher.group(0);String dlink = tmp.substring(9, tmp.length() - 2);realURL = dlink.replaceAll("\\\\", "");}return realURL;}/*** 获取并输入验证码* * @return map{vcode_str:请求的vcode值, vcode_input:输入的验证码}*/public static Map<String, String> generateValidateCode(int count) {// 下载超过3次,需要验证码,获取vcode和img地址Map<String, String> vcodeResponse = HttpUtils.get(getvcodeURL, cookie);String res = vcodeResponse.get("body");System.out.println("获取vcode:" + vcodeResponse.get("body"));Gson gsonVcode = new Gson();Response20 responseVcode = gsonVcode.fromJson(res, Response20.class);String vcode = responseVcode.getVcode();String imgURL = responseVcode.getImg();System.out.println("vcode值:" + vcode);System.out.println("验证码地址:" + imgURL);// 请求验证码HttpUtils.saveImage(imgURL, cookie);System.out.print("查看图片,输入验证码(第" + count + "次尝试/共5次):");InputStreamReader is_reader = new InputStreamReader(System.in);Map<String, String> map = new HashMap<String, String>();try {String result = new BufferedReader(is_reader).readLine();System.out.println("输入的验证码为:" + result + "\n");map.put("vcode_str", vcode);map.put("vcode_input", result);} catch (IOException e) {e.printStackTrace();}return map;}/*** 正则匹配出json字符串,将json字符串转化为java对象。*/public static Map<String, String> getBodyParams(String body) {Map<String, String> map = new HashMap<String, String>();String setData = "";Pattern pattern_setData = Pattern.compile("setData.*?;");Matcher matcher_setData = pattern_setData.matcher(body);if (matcher_setData.find()) {String tmp = matcher_setData.group(0);setData = tmp.substring(8, tmp.length() - 2);// System.out.println("setData:" + setData + "\n");Gson gson = new Gson();SetDataBean bean = gson.fromJson(setData, SetDataBean.class);System.out.println("sign--" + bean.getSign());System.out.println("token--" + bean.getBdstoken());System.out.println("timestamp--" + bean.getTimestamp());System.out.println("uk--" + bean.getUk());System.out.println("shareid--" + bean.getShareid());System.out.println("fs_id--" + bean.getFile_list().getList()[0].getFs_id());System.out.println("file_name--" + bean.getFile_list().getList()[0].getServer_filename());System.out.println("size--" + bean.getFile_list().getList()[0].getSize());System.out.println("app_id--" + bean.getFile_list().getList()[0].getApp_id() + "\n");map.put("sign", bean.getSign());map.put("timestamp", bean.getTimestamp());map.put("bdstoken", bean.getBdstoken());map.put("app_id", bean.getFile_list().getList()[0].getApp_id());map.put("uk", bean.getUk());map.put("shareid", bean.getShareid());map.put("primaryid", bean.getShareid());map.put("fs_id", bean.getFile_list().getList()[0].getFs_id());map.put("fid_list", bean.getFile_list().getList()[0].getFs_id());map.put("server_filename", bean.getFile_list().getList()[0].getServer_filename());map.put("size", bean.getFile_list().getList()[0].getSize());}return map;}}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234

2、HttpUtils:

    package com.example.download;import java.io.BufferedReader;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.net.HttpURLConnection;import java.net.URL;import java.net.URLConnection;import java.util.HashMap;import java.util.Map;public class HttpUtils {/*** 向指定URL发送GET方法的请求 返回cookie,body等* 会返回流里面的内容,如果下载大文件,需要修改,实时保存,避免内存溢出*/public static Map<String, String> get(String url, String cookie) {BufferedReader in = null;Map<String, String> map = new HashMap<String, String>();try {URL realUrl = new URL(url);// 打开和URL之间的连接URLConnection connection = realUrl.openConnection();// 设置通用的请求属性connection.setRequestProperty("accept", "*/*");connection.setRequestProperty("connection", "Keep-Alive");connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");connection.setConnectTimeout(5000);connection.setReadTimeout(5000);if (null != cookie) {//System.out.println("携带的Cookie:" + cookie);connection.setRequestProperty("Cookie", cookie);}// 建立实际的连接connection.connect();// 定义 BufferedReader输入流来读取URL的响应in = new BufferedReader(new InputStreamReader(connection.getInputStream()));StringBuffer sb = new StringBuffer();String line;while ((line = in.readLine()) != null) {sb.append(line + "\n");//System.out.println("内容:" + line);}String c = connection.getHeaderField("Set-Cookie");map.put("cookie", c);map.put("body", sb.toString());return map;} catch (Exception e) {System.err.println(e.getMessage());} finally {try {if (in != null) {in.close();}} catch (Exception e2) {e2.printStackTrace();}}return null;}/*** 保存验证码*/public static Map<String, String> saveImage(String url, String cookie) {Map<String, String> map = new HashMap<String, String>();InputStream in = null;FileOutputStream fos = null;try {URL realUrl = new URL(url);// 打开和URL之间的连接URLConnection connection = realUrl.openConnection();// 设置通用的请求属性connection.setRequestProperty("accept", "*/*");connection.setRequestProperty("connection", "Keep-Alive");connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");connection.setConnectTimeout(5000);connection.setReadTimeout(5000);if (null != cookie) {connection.setRequestProperty("Cookie", cookie);}// 建立实际的连接connection.connect();in = connection.getInputStream();fos = new FileOutputStream("img.jpeg");int b;while((b= in.read())!=-1){fos.write(b);}return map;} catch (Exception e) {System.err.println(e.getMessage());} finally {try {if (in != null) {in.close();}if(fos != null){fos.close();}} catch (Exception e2) {e2.printStackTrace();}}return null;}static int downloadSize = 0;static boolean isReading = false;//是否在读流,更新进度static long startTime = 0 ;static long endTime = 0 ;/*** 下载文件*/public static Map<String, String> download(String url, String cookie, String filename, final String totalSize) {InputStream in = null;FileOutputStream fos = null;Map<String, String> map = new HashMap<String, String>();try {URL realUrl = new URL(url);// 打开和URL之间的连接URLConnection connection = realUrl.openConnection();// 设置通用的请求属性connection.setRequestProperty("accept", "*/*");connection.setRequestProperty("connection", "Keep-Alive");connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");connection.setConnectTimeout(10000);//          connection.setReadTimeout(5000);if (null != cookie) {connection.setRequestProperty("Cookie", cookie);}// 建立实际的连接connection.connect();in = connection.getInputStream();fos = new FileOutputStream(filename);System.out.println("保存文件名称:" + filename);System.out.println("文件总大小:" + totalSize);//利用字符数组读取流数据startTime = System.currentTimeMillis();//每隔1s读一次数据new Thread(){@Overridepublic void run() {String total = UnitSwitch.formatSize(Long.parseLong(totalSize));StringBuffer sb = new StringBuffer();for (int i = 0; i < 20; i++) {sb.append("\b");}while(isReading){endTime = System.currentTimeMillis();String speed = UnitSwitch.calculateSpeed(downloadSize, endTime-startTime);System.out.println(UnitSwitch.formatSize(downloadSize) + "/" + total + ",平均下载速率:" + speed);try {sleep(2000);} catch (InterruptedException e) {e.printStackTrace();}}}}.start();isReading = true;int len;byte[] arr = new byte[1024 * 8];while((len = in.read(arr)) != -1) {fos.write(arr, 0, len);downloadSize += len;}endTime = System.currentTimeMillis();String speed = UnitSwitch.calculateSpeed(downloadSize, endTime-startTime);String total = UnitSwitch.formatSize(Long.parseLong(totalSize));System.out.println(UnitSwitch.formatSize(downloadSize) + "/" + total + ",平均下载速率:" + speed);System.out.println("下载完成,总耗时:" + (endTime - startTime)/1000 + "秒");return map;} catch (Exception e) {System.err.println(e.getMessage());} finally {isReading = false;try {if (in != null) {in.close();}if(fos != null){fos.close();}} catch (Exception e2) {e2.printStackTrace();}}return null;}/*** 发送HttpPost请求* * @param strURL*            服务地址* @param params* * @return 成功:返回json字符串<br/>*/public static String post(String strURL, Map<String, String> params, String cookie) {try {URL url = new URL(strURL);// 创建连接HttpURLConnection connection = (HttpURLConnection) url.openConnection();connection.setDoOutput(true);connection.setDoInput(true);connection.setUseCaches(false);connection.setInstanceFollowRedirects(true);connection.setRequestMethod("POST"); // 设置请求方式connection.setRequestProperty("Accept", "*/*"); // 设置接收数据的格式connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); // 设置发送数据的格式if (null != cookie) {System.out.println("携带的Cookie:" + cookie);connection.setRequestProperty("Cookie", cookie);}connection.connect();OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8"); // utf-8编码StringBuffer sb = new StringBuffer();for (String s : params.keySet()) {sb.append(s + "=" + params.get(s) + "&");}System.out.println("携带的参数:" + sb.toString().substring(0, sb.length() - 1));out.append(sb.toString().substring(0, sb.length() - 1));out.flush();out.close();int code = connection.getResponseCode();BufferedReader in = null;if (code == 200) {in = new BufferedReader(new InputStreamReader(connection.getInputStream()));} else {in = new BufferedReader(new InputStreamReader(connection.getErrorStream()));}System.out.println("响应码:" + code);// 定义BufferedReader输入流来读取URL的响应String line;StringBuffer sb1 = new StringBuffer();while ((line = in.readLine()) != null) {sb1.append(line);}return sb1.toString();} catch (IOException e) {System.err.println(e.getMessage());return "error";}}}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267

3、UnitSwitch:

package com.example.download;
import java.text.DecimalFormat;
public class UnitSwitch {/*** 处理文件大小*/public static String formatSize(long size) {DecimalFormat fnum = new DecimalFormat("##0.0");String result;if (size > (1024 * 1024 * 1024)) {result = fnum.format((size / ((float) (1024 * 1024 * 1024)))) + "GB";}else if (size > (1024 * 1024)) {result = fnum.format((size / ((float) (1024 * 1024)))) + "MB";} else if (size > 1024) {result = fnum.format((float) size / ((float) 1024)) + "KB";} else {result = String.valueOf((int) size) + "B";}return result;}/*** @author gaoqiang*         <p>*         计算网络速率*         <p>*         返回的格式 Kb/s* @param delta*            : 传入一个Bytes数据* @param duration_time*            : 下载delta数据所需要用的时间* @return*/public static String calculateSpeed(long delta, long duration_time) {DecimalFormat fnum = new DecimalFormat("##0.0");String speedStr;float speed = ((float) delta * 1000 / (float) (duration_time));// 毫秒转换if (speed > (1024 * 1024)) {speedStr = fnum.format((speed / ((float) (1024 * 1024)))) + "M/s";} else if (speed > 1024) {speedStr = fnum.format((float) speed / ((float) 1024)) + "K/s";} else {speedStr = String.valueOf((int) speed) + "B/s";}return speedStr;}
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50

4、Response20:

    package com.example.bean;/*** 服务器返回的json,转java对象* 错误码为20 代表需要验证码* @author gaoqiang**/public class Response20 {String errno;String request_id;String server_time;String vcode;String img;public String getErrno() {return errno;}public void setErrno(String errno) {this.errno = errno;}public String getRequest_id() {return request_id;}public void setRequest_id(String request_id) {this.request_id = request_id;}public String getServer_time() {return server_time;}public void setServer_time(String server_time) {this.server_time = server_time;}public String getVcode() {return vcode;}public void setVcode(String vcode) {this.vcode = vcode;}public String getImg() {return img;}public void setImg(String img) {this.img = img;}}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58

5、SetDataBean:

    package com.example.bean;public class SetDataBean {private String sign;private String timestamp;private String bdstoken;private String uk;private String shareid;private FileList file_list;public String getSign() {return sign;}public void setSign(String sign) {this.sign = sign;}public String getTimestamp() {return timestamp;}public void setTimestamp(String timestamp) {this.timestamp = timestamp;}public String getBdstoken() {return bdstoken;}public void setBdstoken(String bdstoken) {this.bdstoken = bdstoken;}public String getUk() {return uk;}public void setUk(String uk) {this.uk = uk;}public String getShareid() {return shareid;}public void setShareid(String shareid) {this.shareid = shareid;}public FileList getFile_list() {return file_list;}public void setFile_list(FileList file_list) {this.file_list = file_list;}public static class FileList {String errno;List[] list;public String getErrno() {return errno;}public void setErrno(String errno) {this.errno = errno;}public List[] getList() {return list;}public void setList(List[] list) {this.list = list;}}public static class List {String app_id;String fs_id;String server_filename;String size;public String getApp_id() {return app_id;}public void setApp_id(String app_id) {this.app_id = app_id;}public String getFs_id() {return fs_id;}public void setFs_id(String fs_id) {this.fs_id = fs_id;}public String getServer_filename() {return server_filename;}public void setServer_filename(String server_filename) {this.server_filename = server_filename;}public String getSize() {return size;}public void setSize(String size) {this.size = size;}}}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125

6、运行的截图:

运行的参数图: 

效果图: 

亲测有效。百度网盘请求的参数可能会变,但是方法不会变。通过浏览器抓包就可以分析修改。 
工程源码下载地址:http://download.csdn.net/download/gaopinqiang/10197336

JAVA获取百度网盘下载真实地址相关推荐

  1. 获取百度网盘下载真实地址

    这是一个java写的获取百度网盘真实下载链接进行下载的程序. 程序里面一些参数拼接是根据浏览器抓包来的.具体的抓包方法网上一大堆,可以参考.这里给出了源码和导出的jar包. url网址使用于百度分享的 ...

  2. Java百度网盘创建链接,java获取百度网盘真实下载链接的方法

    本文实例讲述了java获取百度网盘真实下载链接的方法.分享给大家供大家参考.具体如下: 目前还存在一个问题,同一ip在获取3次以后会出现验证码,会获取失败,感兴趣的朋友对此可以加以完善. 返回的Lis ...

  3. 千方百计获取百度网盘下载链接

    千方百计获取百度网盘下载链接 重要的事情说三遍: 高手勿喷! 高手勿喷! 高手勿喷! 以前看过一篇帖子是在手机上获取百度云的下载链接然后在发送到电脑上, 这样的话百度云后台会判定为两次请求, 请求同一 ...

  4. IDM下载百度网盘文件,获取百度网盘文件url地址,破解

    下面是谷歌插件,你用这个里面的谷歌进入百度网盘,会有一个显示百度网盘文件链接选项,复制这个链接到IDM就可以了. 链接:https://pan.baidu.com/s/1B0C-VyWvf7xc5Y1 ...

  5. 怎样获取百度网盘下载链接

    百度网盘限速和会员限制一直是我们头疼的问题,所以今天我就来推荐一款神器tampermonkey.下面我就来说一下详细的步骤. 1.下载油猴 tampermonkey据说运行的时候有点占内存,楼主自己不 ...

  6. Java程序员必备!java课程百度网盘下载

    前言 今日博主听闻,现在很多培训出来的应届生薪资都赶上了摸爬滚打两三年的朋友,讲道理,这说不过去啊 作为同行来说,这个行业发展很快,技术更新很快,淘汰也很快,千万不要再找借口了,想吃这碗饭不如好好思考 ...

  7. java JDK-8u221-windows-x64百度网盘下载

    https://pan.baidu.com/s/10-BgJAxvf1Ncldbttvb3zg 提取码:z2wu

  8. 百度网盘——下载限速问题解决方案(油猴(Tampermonkey)+百度网盘直链下载助手+IDM)

    一.基本概念 Tampermonkey(油猴):Tampermonkey插件是一个免费的浏览器扩展和最为流行的用户脚本管理器,拥有适用于 Chrome, Microsoft Edge, Safari, ...

  9. IDM下载器使用方法详解:百度网盘下载,视频会员一网打尽!

    idm是海内外都非常受欢迎的一款下载管理软件.它支持视频媒体嗅探和多线程下载,能够完美替代谷歌Chrome浏览器.Edge浏览器等浏览器的原生下载功能.在浏览器中单击下载链接时,idm将接管浏览器的原 ...

最新文章

  1. linux多用户怎么表示,Linux如何建立多用户
  2. java operators_Java Basic Operators
  3. [Jsoi2016]最佳团体 BZOJ4753 01分数规划+树形背包/dfs序
  4. spring+cxf调用webservice接口
  5. 数塔 HDU - 2084
  6. 高性能、高并发、高扩展性和可读性的网络服务器架构:StateThreads
  7. C# params的用法详解
  8. [CQOI2018] 交错序列(矩阵加速优化dp)
  9. 5种方式,判断一个数组中是否包含某个元素
  10. Kubernetes 1.5安装
  11. spring4笔记----spring生命周期属性
  12. 三、EXCEL复制数字到txt文件,存在空格
  13. AR涂涂乐⭐七、(end)取消“识别成功”提示面片、加入太阳系及其交互功能、退出按钮设置
  14. DNA甲基化可实现转座因子驱动的基因组扩增
  15. 禅与摩托车维修艺术语录摘抄(1)
  16. Scrum: 谁是利益相关者?
  17. 编译原理及编译程序构造-绪论
  18. android动态请求权限
  19. 1031. 两个非重叠子数组的最大和-构造子数组和数组遍历数组
  20. 樱花庄的宠物女孩AtCoder Grand Contest 015E - Mr.Aoki Incubator

热门文章

  1. 搜索计算机无法输入法,Windows10左下角搜索框无法输入字符的两种解决方法
  2. mp2551总线收发器芯片作用_高速CAN收发器MCP2551
  3. 搞日租房的Airbnb,如何用机器学习对接上百万的房东和租客?
  4. Tableau的安装与下载
  5. 机器学习数学基础——群论
  6. 为什么Tesla显卡那么贵
  7. 电脑崩溃?黑客最爱邮件入侵方式,在双十一也要保护好网络安全!
  8. chrome不显示数学公式
  9. yunos的工程模式
  10. 服务器防火墙软件 —— iptables