yanximin / weibopicdownloader Goto Github PK
View Code? Open in Web Editor NEW免登录下载微博图片 爬虫 Download Weibo Images without Logging-in
免登录下载微博图片 爬虫 Download Weibo Images without Logging-in
RT
是修改 WeiboDownloader.java 33 行么?
有没有png我不知道,但是肯定还有gif啊。
FileUtils.byte2File(imgbytes,IMG_LOCATION + containerId.substring(6), i+1+".jpg");
后缀名还是要从webUrl获得一下的嗯
我不会java所以不能PR帮你改了~~~
我用python移植了这个repo
https://github.com/nondanee/weiboPicDownloader
可不可以在你这里挂一下啊(逃
超过9张图后面的图没有识别下单下来
原因:微博的json格式改了
解决办法 在WeiboUtils类中的getImgURL方法改成:
private static int getImgURL(String containerid,int page, List urls) throws ParseException, IOException{
String url = "https://m.weibo.cn/api/container/getIndex?count=25&page="+page+"&containerid="+containerid;
HttpClient httpClient = getHttpClient();
HttpGet get = new HttpGet(url);
get.setHeader("User-Agent", USER_AGENT);
HttpResponse response = httpClient.execute(get);
String ret = EntityUtils.toString(response.getEntity(), "utf-8");
JsonObject root = new JsonParser().parse(ret).getAsJsonObject();
JsonObject asJsonObject = root.getAsJsonObject("data");
JsonArray array = asJsonObject.getAsJsonArray("cards");
System.out.println(array);
for(int i=0;i<array.size();i++){
JsonObject mblog = array.get(i).getAsJsonObject().getAsJsonObject("mblog");
if(mblog!=null){
JsonArray pics = mblog.getAsJsonArray("pics");
if(pics!=null){
for(int j=0;j<pics.size();j++){
JsonObject o = pics.get(j).getAsJsonObject();
JsonObject large = o.getAsJsonObject("large");
if(large!=null){
urls.add(large.get("url").getAsString());
}
}
}
}
}
return array.size();
}
保存后运行即可
直接运行出错,编译差几个架包,希望能够全面一下.
Exception in thread "main" java.lang.UnsupportedClassVersionError: weibo/WeiboDownloader :
Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: weibo.WeiboDownloader. Program will exit.
下载没反应,设置没问题,不知道具体什么情况!
反馈一下,感谢,已star
请问还能用吗 有点久远了 另外下载一直完成不了,文件是多大呀?
启动之后只会创建文件夹,不会下载图片
提示解析异常,该如何解决,谢谢
能按照微博内容重命名图片吗
今天尝试了一下在微博解析就失效了
微博多的会分析着就闪退,或者在下载着就闪退
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.