• 【图片】批量获取几万张图片


    代码

    用途:需要图片时我们经常是去百度里随便找几张,次数多了就有点烦了,这个工具类就是批量获取几万张图片的url和描述。
    1. public class PicUrls {
    2. private static final String HOST0 = "http://img1.mm131.com/pic/";//网站【http://www.mm131.com/】
    3. private static final String HOST1 = "http://img.mmjpg.com/";//网站【http://www.mmjpg.com/】
    4. private static final String HOST2 = "http://pic.meituba.com/uploads/allimg/";//网站【http://www.meituba.com/】
    5. public static final UrlBean BIG_BEANS_0 = new UrlBean.Builder()//http://pic.meituba.com/uploads/allimg/2015/10/23/220.jpg
    6. .host(HOST2).urlHeader("2015/10/23/").picIndexFrom(220).picCount(100).picDes("100张动漫卡通壁纸").build();
    7. public static final UrlBean BIG_BEANS_1 = new UrlBean.Builder()//http://pic.meituba.com/uploads/allimg/2017/03/27/121_5600.jpg
    8. .host(HOST2).urlHeader("2017/03/27/121_").picIndexFrom(5600).picCount(100).picDes("100张搞笑内涵图片").build();
    9. public static final UrlBean BIG_BEANS_2 = new UrlBean.Builder()//http://pic.meituba.com/uploads/allimg/2015/10/23/360.jpg
    10. .host(HOST2).urlHeader("2015/10/23/").picIndexFrom(360).picCount(750).picDes("750张性感美女写真图片").build();
    11. public static final UrlBean BIG_BEANS_3 = new UrlBean.Builder()//http://pic.meituba.com/uploads/allimg/2016/03/25/43_20335.jpg
    12. .host(HOST2).urlHeader("2016/03/25/43_").picIndexFrom(20335).picCount(1400).picDes("1400张动漫卡通壁纸").build();
    13. private static final UrlBean[] simpleBeans = {
    14. //http://img1.mm131.com/pic/996/1.jpg
    15. new UrlBean.Builder().host(HOST0).urlHeader("996/").picCount(10).picDes("北影校花余雨高清写真图片").build(),
    16. new UrlBean.Builder().host(HOST0).urlHeader("2958/").picCount(10).picDes("童颜嫩妹桃子黑丝大尺度诱惑").build(),
    17. new UrlBean.Builder().host(HOST0).urlHeader("2939/").picCount(10).picDes("清纯少女刘奕宁酥胸覆白色内衣").build(),
    18. new UrlBean.Builder().host(HOST0).urlHeader("2343/").picCount(10).picDes("萌妹销魂写真身材惹火让人欲罢不能").build(),
    19. new UrlBean.Builder().host(HOST0).urlHeader("2935/").picCount(10).picDes("性感女神杨晨晨透视睡衣大胆秀乳").build(),
    20. //http://img.mmjpg.com/2015/444/1.jpg
    21. new UrlBean.Builder().host(HOST1).urlHeader("2015/444/").picCount(10).picDes("模范学院美少女柳侑绮制服大片").build(),
    22. new UrlBean.Builder().host(HOST1).urlHeader("2015/74/").picCount(10).picDes("极品女神可儿私拍秀完美身材").build(),
    23. new UrlBean.Builder().host(HOST1).urlHeader("2017/990/").picCount(10).picDes("香艳妹子雪白的美胸绝对让你大饱眼福").build(),
    24. new UrlBean.Builder().host(HOST1).urlHeader("2017/962/").picCount(10).picDes("真诱人啊!女神雪白的美胸看着很有感觉").build(),
    25. new UrlBean.Builder().host(HOST1).urlHeader("2017/936/").picCount(10).picDes("身材娇美纯天然美女小叶子美胸艺术照").build(),
    26. //http://pic.meituba.com/uploads/allimg/2015/10/23/247.jpg
    27. new UrlBean.Builder().host(HOST2).urlHeader("2015/10/23/").picIndexFrom(247).picCount(10).picDes("呆萌可爱的哆啦A梦").build(),
    28. new UrlBean.Builder().host(HOST2).urlHeader("2016/03/25/43_").picIndexFrom(20574).picCount(10).picDes("海贼王红发香克斯").build(),
    29. new UrlBean.Builder().host(HOST2).urlHeader("2016/03/25/44_").picIndexFrom(11275).picCount(10).picDes("英雄联盟图片").build(),
    30. new UrlBean.Builder().host(HOST2).urlHeader("2016/07/30/43_").picIndexFrom(485).picCount(10).picDes("精选超萌小猫咪").build(),
    31. new UrlBean.Builder().host(HOST2).urlHeader("2016/09/08/43_").picIndexFrom(476).picCount(10).picDes("可爱快乐的女孩动漫").build(),
    32. };
    33. //******************************************************************************************
    34. /**
    35. * 10*15张各种各样的带有描述的图片
    36. */
    37. public static ArrayList<BasicPicBean> getPicList() {
    38. List<UrlBean> urlList = Arrays.asList(simpleBeans);
    39. ArrayList<BasicPicBean> picList = new ArrayList<>();
    40. for (UrlBean bean : urlList) {
    41. picList.addAll(getPicList(bean));
    42. }
    43. return picList;
    44. }
    45. /**
    46. * 每一个UrlBean都有超多图片,多的有几千张
    47. */
    48. public static ArrayList<BasicPicBean> getPicList(UrlBean bean) {
    49. ArrayList<BasicPicBean> picList = new ArrayList<>();
    50. for (int i = 0; i < bean.picCount; i++) {
    51. String picIndex = "" + (bean.picIndexFrom + i);
    52. for (int j = picIndex.length(); j < bean.minLength; j++) {
    53. if (picIndex.length() < bean.minLength) {
    54. picIndex = "0" + picIndex;
    55. } else break;
    56. }
    57. String picUrl = bean.host + bean.urlHeader + picIndex + bean.urlEnder;//例如.../1.jpg
    58. String picDes = bean.picDes + "-" + i;
    59. picList.add(new BasicPicBean(picUrl, picDes, i));
    60. }
    61. return picList;
    62. }
    63. //******************************************************************************************
    64. static class UrlBean {
    65. public String picDes;//图片描述
    66. public String host;//存放图片的主机地址
    67. public String urlHeader;
    68. public String urlEnder;//默认为= ".jpg"
    69. public int picCount;//此系列图片的数量。所有图片都是以数字命名的,比如1.jpg、2.jpg
    70. public int picIndexFrom;//此系列图片开始的序号位置,默认为1
    71. public int minLength;//如,当为1.jpg时实际为01.jpg或001.jpg
    72. private UrlBean(Builder builder) {
    73. picDes = builder.picDes;
    74. host = builder.host;
    75. urlHeader = builder.urlHeader;
    76. urlEnder = builder.urlEnder;
    77. picCount = builder.picCount;
    78. picIndexFrom = builder.picIndexFrom;
    79. minLength = builder.minLength;
    80. }
    81. static final class Builder {
    82. private String picDes = "包青天作品";
    83. private String host = "";
    84. private String urlHeader = "";
    85. private String urlEnder = ".jpg";//默认为".jpg"
    86. private int picCount = 1;
    87. private int picIndexFrom = 1;
    88. private int minLength = 1;
    89. public Builder() {
    90. }
    91. public Builder urlHeader(String val) {
    92. urlHeader = val;
    93. return this;
    94. }
    95. public Builder urlEnder(String val) {
    96. urlEnder = val;
    97. return this;
    98. }
    99. public Builder picCount(int val) {
    100. picCount = val;
    101. return this;
    102. }
    103. public Builder picIndexFrom(int val) {
    104. picIndexFrom = val;
    105. return this;
    106. }
    107. public Builder minLength(int val) {
    108. minLength = val;
    109. return this;
    110. }
    111. public Builder host(String val) {
    112. host = val;
    113. return this;
    114. }
    115. public Builder picDes(String val) {
    116. picDes = val;
    117. return this;
    118. }
    119. public UrlBean build() {
    120. return new UrlBean(this);
    121. }
    122. }
    123. }
    124. //******************************************************************************************
    125. public static class BasicPicBean {
    126. public String url;
    127. public String name;
    128. public int index;
    129. public BasicPicBean(String url, String name, int index) {
    130. this.url = url;
    131. this.name = name;
    132. this.index = index;
    133. }
    134. }
    135. }
    2017-6-7

    http://www.mm131.com/

    北影校花余雨高清写真图片

    1. http://img1.mm131.com/pic/996/1.jpg
    2. http://img1.mm131.com/pic/996/2.jpg
    3. http://img1.mm131.com/pic/996/3.jpg
    4. http://img1.mm131.com/pic/996/4.jpg
    5. http://img1.mm131.com/pic/996/5.jpg
    6. http://img1.mm131.com/pic/996/6.jpg
    7. http://img1.mm131.com/pic/996/7.jpg
    8. http://img1.mm131.com/pic/996/8.jpg
    9. http://img1.mm131.com/pic/996/9.jpg
    10. http://img1.mm131.com/pic/996/10.jpg

    童颜嫩妹桃子黑丝大尺度诱惑

    1. http://img1.mm131.com/pic/2958/1.jpg
    2. http://img1.mm131.com/pic/2958/2.jpg
    3. http://img1.mm131.com/pic/2958/3.jpg
    4. http://img1.mm131.com/pic/2958/4.jpg
    5. http://img1.mm131.com/pic/2958/5.jpg
    6. http://img1.mm131.com/pic/2958/6.jpg
    7. http://img1.mm131.com/pic/2958/7.jpg
    8. http://img1.mm131.com/pic/2958/8.jpg
    9. http://img1.mm131.com/pic/2958/9.jpg
    10. http://img1.mm131.com/pic/2958/10.jpg

    清纯少女刘奕宁酥胸覆白色内衣

    1. http://img1.mm131.com/pic/2939/1.jpg
    2. http://img1.mm131.com/pic/2939/2.jpg
    3. http://img1.mm131.com/pic/2939/3.jpg
    4. http://img1.mm131.com/pic/2939/4.jpg
    5. http://img1.mm131.com/pic/2939/5.jpg
    6. http://img1.mm131.com/pic/2939/6.jpg
    7. http://img1.mm131.com/pic/2939/7.jpg
    8. http://img1.mm131.com/pic/2939/8.jpg
    9. http://img1.mm131.com/pic/2939/9.jpg
    10. http://img1.mm131.com/pic/2939/10.jpg

    萌妹销魂写真身材惹火让人欲罢不能

    1. http://img1.mm131.com/pic/2343/1.jpg
    2. http://img1.mm131.com/pic/2343/2.jpg
    3. http://img1.mm131.com/pic/2343/3.jpg
    4. http://img1.mm131.com/pic/2343/4.jpg
    5. http://img1.mm131.com/pic/2343/5.jpg
    6. http://img1.mm131.com/pic/2343/6.jpg
    7. http://img1.mm131.com/pic/2343/7.jpg
    8. http://img1.mm131.com/pic/2343/8.jpg
    9. http://img1.mm131.com/pic/2343/9.jpg
    10. http://img1.mm131.com/pic/2343/10.jpg

    性感女神杨晨晨透视睡衣大胆秀乳

    1. http://img1.mm131.com/pic/2935/1.jpg
    2. http://img1.mm131.com/pic/2935/2.jpg
    3. http://img1.mm131.com/pic/2935/3.jpg
    4. http://img1.mm131.com/pic/2935/4.jpg
    5. http://img1.mm131.com/pic/2935/5.jpg
    6. http://img1.mm131.com/pic/2935/6.jpg
    7. http://img1.mm131.com/pic/2935/7.jpg
    8. http://img1.mm131.com/pic/2935/8.jpg
    9. http://img1.mm131.com/pic/2935/9.jpg
    10. http://img1.mm131.com/pic/2935/10.jpg

    http://www.mmjpg.com/

    模范学院美少女柳侑绮制服大片

    1. http://img.mmjpg.com/2015/444/1.jpg
    2. http://img.mmjpg.com/2015/444/2.jpg
    3. http://img.mmjpg.com/2015/444/3.jpg
    4. http://img.mmjpg.com/2015/444/4.jpg
    5. http://img.mmjpg.com/2015/444/5.jpg
    6. http://img.mmjpg.com/2015/444/6.jpg
    7. http://img.mmjpg.com/2015/444/7.jpg
    8. http://img.mmjpg.com/2015/444/8.jpg
    9. http://img.mmjpg.com/2015/444/9.jpg
    10. http://img.mmjpg.com/2015/444/10.jpg

    极品女神可儿私拍秀完美身材

    1. http://img.mmjpg.com/2015/74/1.jpg
    2. http://img.mmjpg.com/2015/74/2.jpg
    3. http://img.mmjpg.com/2015/74/3.jpg
    4. http://img.mmjpg.com/2015/74/4.jpg
    5. http://img.mmjpg.com/2015/74/5.jpg
    6. http://img.mmjpg.com/2015/74/6.jpg
    7. http://img.mmjpg.com/2015/74/7.jpg
    8. http://img.mmjpg.com/2015/74/8.jpg
    9. http://img.mmjpg.com/2015/74/9.jpg
    10. http://img.mmjpg.com/2015/74/10.jpg

    香艳妹子雪白的美胸绝对让你大饱眼福

    1. http://img.mmjpg.com/2017/990/1.jpg
    2. http://img.mmjpg.com/2017/990/2.jpg
    3. http://img.mmjpg.com/2017/990/3.jpg
    4. http://img.mmjpg.com/2017/990/4.jpg
    5. http://img.mmjpg.com/2017/990/5.jpg
    6. http://img.mmjpg.com/2017/990/6.jpg
    7. http://img.mmjpg.com/2017/990/7.jpg
    8. http://img.mmjpg.com/2017/990/8.jpg
    9. http://img.mmjpg.com/2017/990/9.jpg
    10. http://img.mmjpg.com/2017/990/10.jpg

    真诱人啊!女神雪白的美胸看着很有感觉

    1. http://img.mmjpg.com/2017/962/1.jpg
    2. http://img.mmjpg.com/2017/962/2.jpg
    3. http://img.mmjpg.com/2017/962/3.jpg
    4. http://img.mmjpg.com/2017/962/4.jpg
    5. http://img.mmjpg.com/2017/962/5.jpg
    6. http://img.mmjpg.com/2017/962/6.jpg
    7. http://img.mmjpg.com/2017/962/7.jpg
    8. http://img.mmjpg.com/2017/962/8.jpg
    9. http://img.mmjpg.com/2017/962/9.jpg
    10. http://img.mmjpg.com/2017/962/10.jpg

    身材娇美纯天然美女小叶子美胸艺术照

    1. http://img.mmjpg.com/2017/936/1.jpg
    2. http://img.mmjpg.com/2017/936/2.jpg
    3. http://img.mmjpg.com/2017/936/3.jpg
    4. http://img.mmjpg.com/2017/936/4.jpg
    5. http://img.mmjpg.com/2017/936/5.jpg
    6. http://img.mmjpg.com/2017/936/6.jpg
    7. http://img.mmjpg.com/2017/936/7.jpg
    8. http://img.mmjpg.com/2017/936/8.jpg
    9. http://img.mmjpg.com/2017/936/9.jpg
    10. http://img.mmjpg.com/2017/936/10.jpg

    http://www.meituba.com/

    呆萌可爱的哆啦A梦

    1. http://pic.meituba.com/uploads/allimg/2015/10/23/247.jpg
    2. http://pic.meituba.com/uploads/allimg/2015/10/23/248.jpg
    3. http://pic.meituba.com/uploads/allimg/2015/10/23/249.jpg
    4. http://pic.meituba.com/uploads/allimg/2015/10/23/250.jpg
    5. http://pic.meituba.com/uploads/allimg/2015/10/23/251.jpg
    6. http://pic.meituba.com/uploads/allimg/2015/10/23/252.jpg
    7. http://pic.meituba.com/uploads/allimg/2015/10/23/253.jpg
    8. http://pic.meituba.com/uploads/allimg/2015/10/23/254.jpg
    9. http://pic.meituba.com/uploads/allimg/2015/10/23/255.jpg
    10. http://pic.meituba.com/uploads/allimg/2015/10/23/256.jpg

    海贼王红发香克斯

    1. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20574.jpg
    2. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20575.jpg
    3. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20576.jpg
    4. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20577.jpg
    5. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20578.jpg
    6. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20579.jpg
    7. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20580.jpg
    8. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20581.jpg
    9. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20582.jpg
    10. http://pic.meituba.com/uploads/allimg/2016/03/25/43_20583.jpg

    英雄联盟图片

    1. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11275.jpg
    2. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11276.jpg
    3. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11277.jpg
    4. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11278.jpg
    5. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11279.jpg
    6. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11280.jpg
    7. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11281.jpg
    8. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11282.jpg
    9. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11283.jpg
    10. http://pic.meituba.com/uploads/allimg/2016/03/25/44_11284.jpg

    精选超萌小猫咪

    1. http://pic.meituba.com/uploads/allimg/2016/07/30/43_485.jpg
    2. http://pic.meituba.com/uploads/allimg/2016/07/30/43_486.jpg
    3. http://pic.meituba.com/uploads/allimg/2016/07/30/43_487.jpg
    4. http://pic.meituba.com/uploads/allimg/2016/07/30/43_488.jpg
    5. http://pic.meituba.com/uploads/allimg/2016/07/30/43_489.jpg
    6. http://pic.meituba.com/uploads/allimg/2016/07/30/43_490.jpg
    7. http://pic.meituba.com/uploads/allimg/2016/07/30/43_491.jpg
    8. http://pic.meituba.com/uploads/allimg/2016/07/30/43_492.jpg
    9. http://pic.meituba.com/uploads/allimg/2016/07/30/43_493.jpg
    10. http://pic.meituba.com/uploads/allimg/2016/07/30/43_494.jpg

    可爱快乐的女孩动漫

    1. http://pic.meituba.com/uploads/allimg/2016/09/08/43_476.jpg
    2. http://pic.meituba.com/uploads/allimg/2016/09/08/43_477.jpg
    3. http://pic.meituba.com/uploads/allimg/2016/09/08/43_478.jpg
    4. http://pic.meituba.com/uploads/allimg/2016/09/08/43_479.jpg
    5. http://pic.meituba.com/uploads/allimg/2016/09/08/43_480.jpg
    6. http://pic.meituba.com/uploads/allimg/2016/09/08/43_481.jpg
    7. http://pic.meituba.com/uploads/allimg/2016/09/08/43_482.jpg
    8. http://pic.meituba.com/uploads/allimg/2016/09/08/43_483.jpg
    9. http://pic.meituba.com/uploads/allimg/2016/09/08/43_484.jpg
    10. http://pic.meituba.com/uploads/allimg/2016/09/08/43_485.jpg
    2017-7-27




    附件列表

    • 相关阅读:
      My97DatePicker使用说明文档
      内存溢出之Tomcat内存配置
      myeclipse控制台不显示tomcat信息
      修改 MyEclipse 编辑区域背景颜色
      window.open() 弹出窗体居中
      javascript控制页面控件隐藏显示的两种方法
      (转)MyEclipse7.5.0版注册码破解及激活操作
      [置顶] Android代码读取 android 设备的电池信息
      [置顶] Android代码获得我们手机的cpu序列号
      [置顶] Android高手进阶教程Android常用名令集锦(图文并茂)!
    • 原文地址:https://www.cnblogs.com/baiqiantao/p/6955536.html
    Copyright © 2020-2023  润新知