(),
143 | HttpCookies.getGlobalCookies());
144 | Pattern p = Pattern.compile("window.__INITIAL_STATE__=(.*?});\\(function");
145 | Matcher m = p.matcher(htmlStr);
146 | m.find();
147 | String jsonStr = m.group(1);
148 | JSONArray list = new JSONObject(jsonStr).getJSONObject("member").getJSONObject("favorite").getJSONArray("dougaFolders");
149 | for (int i = 0; i < list.length(); i++) {
150 | JSONObject favlist = list.getJSONObject(i);
151 | FavList fav = new FavList(favlist.getLong("folderId"),
152 | favlist.getInt("resourceCount"), favlist.getString("name"));
153 | Global.index.cbChannel.addItem(fav);
154 | }
155 | }
156 | } catch (Exception e) {
157 | e.printStackTrace();
158 | }
159 | }
160 | }
161 |
--------------------------------------------------------------------------------
/src/nicelee/ui/thread/StreamManager.java:
--------------------------------------------------------------------------------
1 | package nicelee.ui.thread;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.IOException;
5 | import java.io.InputStream;
6 | import java.io.InputStreamReader;
7 |
8 | public class StreamManager extends Thread{
9 | Process process;
10 | InputStream inputStream;
11 | public StreamManager(Process process, InputStream inputStream) {
12 | this.process = process;
13 | this.inputStream = inputStream;
14 | }
15 |
16 | public void run () {
17 | InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
18 | BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
19 | String line = null;
20 | try {
21 | while((line = bufferedReader.readLine()) !=null ) {
22 | System.out.println(line);
23 | }
24 | } catch (IOException e) {
25 | e.printStackTrace();
26 | }
27 | process.destroy();
28 | //System.out.println("转码完毕.");
29 | }
30 | }
--------------------------------------------------------------------------------
/src/org/json/.gitignore:
--------------------------------------------------------------------------------
1 | # ignore eclipse project files
2 | .project
3 | .classpath
4 | # ignore Intellij Idea project files
5 | .idea
6 | *.iml
7 |
--------------------------------------------------------------------------------
/src/org/json/CookieList.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | /**
28 | * Convert a web browser cookie list string to a JSONObject and back.
29 | * @author JSON.org
30 | * @version 2015-12-09
31 | */
32 | public class CookieList {
33 |
34 | /**
35 | * Convert a cookie list into a JSONObject. A cookie list is a sequence
36 | * of name/value pairs. The names are separated from the values by '='.
37 | * The pairs are separated by ';'. The names and the values
38 | * will be unescaped, possibly converting '+' and '%' sequences.
39 | *
40 | * To add a cookie to a cookie list,
41 | * cookielistJSONObject.put(cookieJSONObject.getString("name"),
42 | * cookieJSONObject.getString("value"));
43 | * @param string A cookie list string
44 | * @return A JSONObject
45 | * @throws JSONException
46 | */
47 | public static JSONObject toJSONObject(String string) throws JSONException {
48 | JSONObject jo = new JSONObject();
49 | JSONTokener x = new JSONTokener(string);
50 | while (x.more()) {
51 | String name = Cookie.unescape(x.nextTo('='));
52 | x.next('=');
53 | jo.put(name, Cookie.unescape(x.nextTo(';')));
54 | x.next();
55 | }
56 | return jo;
57 | }
58 |
59 | /**
60 | * Convert a JSONObject into a cookie list. A cookie list is a sequence
61 | * of name/value pairs. The names are separated from the values by '='.
62 | * The pairs are separated by ';'. The characters '%', '+', '=', and ';'
63 | * in the names and values are replaced by "%hh".
64 | * @param jo A JSONObject
65 | * @return A cookie list string
66 | * @throws JSONException
67 | */
68 | public static String toString(JSONObject jo) throws JSONException {
69 | boolean b = false;
70 | final StringBuilder sb = new StringBuilder();
71 | // Don't use the new entrySet API to maintain Android support
72 | for (final String key : jo.keySet()) {
73 | final Object value = jo.opt(key);
74 | if (!JSONObject.NULL.equals(value)) {
75 | if (b) {
76 | sb.append(';');
77 | }
78 | sb.append(Cookie.escape(key));
79 | sb.append("=");
80 | sb.append(Cookie.escape(value.toString()));
81 | b = true;
82 | }
83 | }
84 | return sb.toString();
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/org/json/HTTPTokener.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | /**
28 | * The HTTPTokener extends the JSONTokener to provide additional methods
29 | * for the parsing of HTTP headers.
30 | * @author JSON.org
31 | * @version 2015-12-09
32 | */
33 | public class HTTPTokener extends JSONTokener {
34 |
35 | /**
36 | * Construct an HTTPTokener from a string.
37 | * @param string A source string.
38 | */
39 | public HTTPTokener(String string) {
40 | super(string);
41 | }
42 |
43 |
44 | /**
45 | * Get the next token or string. This is used in parsing HTTP headers.
46 | * @throws JSONException
47 | * @return A String.
48 | */
49 | public String nextToken() throws JSONException {
50 | char c;
51 | char q;
52 | StringBuilder sb = new StringBuilder();
53 | do {
54 | c = next();
55 | } while (Character.isWhitespace(c));
56 | if (c == '"' || c == '\'') {
57 | q = c;
58 | for (;;) {
59 | c = next();
60 | if (c < ' ') {
61 | throw syntaxError("Unterminated string.");
62 | }
63 | if (c == q) {
64 | return sb.toString();
65 | }
66 | sb.append(c);
67 | }
68 | }
69 | for (;;) {
70 | if (c == 0 || Character.isWhitespace(c)) {
71 | return sb.toString();
72 | }
73 | sb.append(c);
74 | c = next();
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/org/json/JSONException.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /**
4 | * The JSONException is thrown by the JSON.org classes when things are amiss.
5 | *
6 | * @author JSON.org
7 | * @version 2015-12-09
8 | */
9 | public class JSONException extends RuntimeException {
10 | /** Serialization ID */
11 | private static final long serialVersionUID = 0;
12 |
13 | /**
14 | * Constructs a JSONException with an explanatory message.
15 | *
16 | * @param message
17 | * Detail about the reason for the exception.
18 | */
19 | public JSONException(final String message) {
20 | super(message);
21 | }
22 |
23 | /**
24 | * Constructs a JSONException with an explanatory message and cause.
25 | *
26 | * @param message
27 | * Detail about the reason for the exception.
28 | * @param cause
29 | * The cause.
30 | */
31 | public JSONException(final String message, final Throwable cause) {
32 | super(message, cause);
33 | }
34 |
35 | /**
36 | * Constructs a new JSONException with the specified cause.
37 | *
38 | * @param cause
39 | * The cause.
40 | */
41 | public JSONException(final Throwable cause) {
42 | super(cause.getMessage(), cause);
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/org/json/JSONPointerException.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | /**
28 | * The JSONPointerException is thrown by {@link JSONPointer} if an error occurs
29 | * during evaluating a pointer.
30 | *
31 | * @author JSON.org
32 | * @version 2016-05-13
33 | */
34 | public class JSONPointerException extends JSONException {
35 | private static final long serialVersionUID = 8872944667561856751L;
36 |
37 | public JSONPointerException(String message) {
38 | super(message);
39 | }
40 |
41 | public JSONPointerException(String message, Throwable cause) {
42 | super(message, cause);
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/org/json/JSONPropertyIgnore.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2018 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | import static java.lang.annotation.ElementType.METHOD;
28 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
29 |
30 | import java.lang.annotation.Documented;
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.Target;
33 |
34 | @Documented
35 | @Retention(RUNTIME)
36 | @Target({METHOD})
37 | /**
38 | * Use this annotation on a getter method to override the Bean name
39 | * parser for Bean -> JSONObject mapping. If this annotation is
40 | * present at any level in the class hierarchy, then the method will
41 | * not be serialized from the bean into the JSONObject.
42 | */
43 | public @interface JSONPropertyIgnore { }
44 |
--------------------------------------------------------------------------------
/src/org/json/JSONPropertyName.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2018 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | import static java.lang.annotation.ElementType.METHOD;
28 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
29 |
30 | import java.lang.annotation.Documented;
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.Target;
33 |
34 | @Documented
35 | @Retention(RUNTIME)
36 | @Target({METHOD})
37 | /**
38 | * Use this annotation on a getter method to override the Bean name
39 | * parser for Bean -> JSONObject mapping. A value set to empty string ""
40 | * will have the Bean parser fall back to the default field name processing.
41 | */
42 | public @interface JSONPropertyName {
43 | /**
44 | * @return The name of the property as to be used in the JSON Object.
45 | */
46 | String value();
47 | }
48 |
--------------------------------------------------------------------------------
/src/org/json/JSONString.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 | /**
3 | * The JSONString
interface allows a toJSONString()
4 | * method so that a class can change the behavior of
5 | * JSONObject.toString()
, JSONArray.toString()
,
6 | * and JSONWriter.value(
Object)
. The
7 | * toJSONString
method will be used instead of the default behavior
8 | * of using the Object's toString()
method and quoting the result.
9 | */
10 | public interface JSONString {
11 | /**
12 | * The toJSONString
method allows a class to produce its own JSON
13 | * serialization.
14 | *
15 | * @return A strictly syntactically correct JSON text.
16 | */
17 | public String toJSONString();
18 | }
19 |
--------------------------------------------------------------------------------
/src/org/json/JSONStringer.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2006 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | import java.io.StringWriter;
28 |
29 | /**
30 | * JSONStringer provides a quick and convenient way of producing JSON text.
31 | * The texts produced strictly conform to JSON syntax rules. No whitespace is
32 | * added, so the results are ready for transmission or storage. Each instance of
33 | * JSONStringer can produce one JSON text.
34 | *
35 | * A JSONStringer instance provides a value
method for appending
36 | * values to the
37 | * text, and a key
38 | * method for adding keys before values in objects. There are array
39 | * and endArray
methods that make and bound array values, and
40 | * object
and endObject
methods which make and bound
41 | * object values. All of these methods return the JSONWriter instance,
42 | * permitting cascade style. For example,
43 | * myString = new JSONStringer()
44 | * .object()
45 | * .key("JSON")
46 | * .value("Hello, World!")
47 | * .endObject()
48 | * .toString();
which produces the string
49 | * {"JSON":"Hello, World!"}
50 | *
51 | * The first method called must be array
or object
.
52 | * There are no methods for adding commas or colons. JSONStringer adds them for
53 | * you. Objects and arrays can be nested up to 20 levels deep.
54 | *
55 | * This can sometimes be easier than using a JSONObject to build a string.
56 | * @author JSON.org
57 | * @version 2015-12-09
58 | */
59 | public class JSONStringer extends JSONWriter {
60 | /**
61 | * Make a fresh JSONStringer. It can be used to build one JSON text.
62 | */
63 | public JSONStringer() {
64 | super(new StringWriter());
65 | }
66 |
67 | /**
68 | * Return the JSON text. This method is used to obtain the product of the
69 | * JSONStringer instance. It will return null
if there was a
70 | * problem in the construction of the JSON text (such as the calls to
71 | * array
were not properly balanced with calls to
72 | * endArray
).
73 | * @return The JSON text.
74 | */
75 | @Override
76 | public String toString() {
77 | return this.mode == 'd' ? this.writer.toString() : null;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/org/json/LICENSE:
--------------------------------------------------------------------------------
1 | ============================================================================
2 |
3 | Copyright (c) 2002 JSON.org
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | The Software shall be used for Good, not Evil.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
24 |
--------------------------------------------------------------------------------
/src/org/json/Property.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /*
4 | Copyright (c) 2002 JSON.org
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | The Software shall be used for Good, not Evil.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | SOFTWARE.
25 | */
26 |
27 | import java.util.Enumeration;
28 | import java.util.Properties;
29 |
30 | /**
31 | * Converts a Property file data into JSONObject and back.
32 | * @author JSON.org
33 | * @version 2015-05-05
34 | */
35 | public class Property {
36 | /**
37 | * Converts a property file object into a JSONObject. The property file object is a table of name value pairs.
38 | * @param properties java.util.Properties
39 | * @return JSONObject
40 | * @throws JSONException
41 | */
42 | public static JSONObject toJSONObject(java.util.Properties properties) throws JSONException {
43 | // can't use the new constructor for Android support
44 | // JSONObject jo = new JSONObject(properties == null ? 0 : properties.size());
45 | JSONObject jo = new JSONObject();
46 | if (properties != null && !properties.isEmpty()) {
47 | Enumeration> enumProperties = properties.propertyNames();
48 | while(enumProperties.hasMoreElements()) {
49 | String name = (String)enumProperties.nextElement();
50 | jo.put(name, properties.getProperty(name));
51 | }
52 | }
53 | return jo;
54 | }
55 |
56 | /**
57 | * Converts the JSONObject into a property file object.
58 | * @param jo JSONObject
59 | * @return java.util.Properties
60 | * @throws JSONException
61 | */
62 | public static Properties toProperties(JSONObject jo) throws JSONException {
63 | Properties properties = new Properties();
64 | if (jo != null) {
65 | // Don't use the new entrySet API to maintain Android support
66 | for (final String key : jo.keySet()) {
67 | Object value = jo.opt(key);
68 | if (!JSONObject.NULL.equals(value)) {
69 | properties.put(key, value.toString());
70 | }
71 | }
72 | }
73 | return properties;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/resources/_.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nICEnnnnnnnLee/AcFunDown/48bb354755074b5b51087dd12df0f501b5ca6434/src/resources/_.jpg
--------------------------------------------------------------------------------
/src/resources/_h.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nICEnnnnnnnLee/AcFunDown/48bb354755074b5b51087dd12df0f501b5ca6434/src/resources/_h.jpg
--------------------------------------------------------------------------------
/src/resources/about.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 作品信息
6 |
19 |
20 |
21 | 作品信息
22 |
23 |
29 | 感谢 (不分先后( ´_ゝ`)
30 |
31 |
36 | 本作以及第三方LICENSE详见本地文件夹或github
37 |
38 |
--------------------------------------------------------------------------------
/src/resources/app.config:
--------------------------------------------------------------------------------
1 | # 下载文件命名格式
2 | ## avId - av号 e.g. av1234567
3 | ## pAv - av 的第几个视频 e.g. p1/p2
4 | ## pDisplay - 合集的第几个视频 e.g. pn1/pn2
5 | ## qn - 清晰度值 e.g. 32/64/80
6 | ## avTitle - av标题
7 | ## clipTitle - 视频小标题
8 | ### 以下可能不存在,仅在收藏夹/UP主视频搜索时有效
9 | ### listName - 集合名称 e.g. 某收藏夹的名称
10 | ### listOwnerName - 集合的拥有者 e.g. 某某某 (假设搜索的是某人的收藏夹)
11 | #### pDisplay 和 pAv 可能不一致, 比如有的ss是分布在不同的av的第一个视频, 有的则是分布在同一av的不同p
12 | ##acfun.name.format = avTitle-pDisplay-clipTitle-qn
13 | # (:条件 格式字符串) 当条件成立时,文件名将增加括号内的格式字符串(注意条件和格式字符串中间的空格)
14 | acfun.name.format = (:listName listName-)avTitle-pDisplay-clipTitle-qn
15 |
16 | # 下载完成后是否马上重命名
17 | # 若为false, 那么会追加到重命名文件, 可以人工运行rename.bat 重命名
18 | acfun.name.doAfterComplete = true
19 | #######################################################################################################
20 | # 下载异常后尝试次数, 0 则异常后不再尝试
21 | acfun.download.maxFailRetry = 3
22 |
23 | # 优先下载格式
24 | # 0: MP4 1:FLV
25 | acfun.format = 0
26 |
27 | # 不尝试获取视频的清晰度,直接提供所有选项 issue#17
28 | acfun.quality.noQualityRequest = true
29 |
30 | # 在控制栏输出ffmpeg运行信息
31 | acfun.debug.ffmpeg = true
32 | #######################################################################################################
33 | # 分页查询时,每页最大显示个数
34 | acfun.pageSize = 5
35 |
36 | # 分页查询时,结果展示方式
37 | ## promptAll 每个av弹出一个Tab页
38 | ## listAll 所有选项在一个Tab页面里呈现
39 | acfun.pageDisplay = listAll
40 | #######################################################################################################
41 | #下载文件保存路径, 可以是相对路径,也可以是绝对路径
42 | acfun.savePath = download/
43 | #acfun.savePath = D:\Workspace\acfun\
44 |
45 | #######################################################################################################
46 | #最大的同时下载任务数
47 | acfun.download.poolSize = 3
48 |
49 | #######################################################################################################
50 | #UI主题
51 | # default swing默认
52 | # system 跟随系统
53 | acfun.theme = default
54 |
55 | #######################################################################################################
56 | #临时文件严格模式开启与否
57 | #开启后,如果已经存在下载好的视频(无论视频损坏与否),该视频对应的临时文件将会被删除
58 | #关闭后,当下载完成后,如果视频大小达标,该视频对应的临时文件将会被删除。某些异常可能会导致临时文件未被删除而一直存在。
59 | # on / off
60 | acfun.restrictTempMode = on
61 |
62 | #######################################################################################################
63 | #是否使用仓库功能
64 | # 开启后,每次下载前都会先从仓库查询记录。 若存在,则不开始任务
65 | acfun.repo = on
66 |
67 | # 仓库功能关闭时,是否仍保存下载成功的记录(即只保存成功的下载记录而不作其它操作)
68 | acfun.repo.save = on
69 |
70 | # 同一视频的不同清晰度算不算同一记录
71 | ## on : 同一视频两种清晰度算不同记录
72 | ## off : 同一视频两种清晰度算相同记录
73 | acfun.repo.definitionStrictMode = off
74 |
75 | #######################################################################################################
76 | # 下载已完成的视频时,是否弹出提示 true / false
77 | acfun.alert.isAlertIfDownloded = true
78 |
79 | # 批量下载时,最大提示框弹出数
80 | acfun.alert.maxAlertPrompt = 5
81 | #######################################################################################################
82 | # 同时支持HTTP + HTTPS 代理
83 | #proxyHost = 127.0.0.1
84 | #proxyPort = 1080
85 |
86 | # 仅代理HTTP
87 | #http.proxyHost = 127.0.0.1
88 | #http.proxyHost = 1080
89 |
90 | # 仅代理HTTPS
91 | #https.proxyHost = 127.0.0.1
92 | #https.proxyPort = 1080
93 |
94 | # SOCKS 代理,支持 HTTP 和 HTTPS 请求
95 | # 注意:如果设置了 SOCKS 代理就不要设 HTTP/HTTPS 代理
96 | #socksProxyHost = 127.0.0.1
97 | #socksProxyPort = 1080
--------------------------------------------------------------------------------
/src/resources/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nICEnnnnnnnLee/AcFunDown/48bb354755074b5b51087dd12df0f501b5ca6434/src/resources/background.png
--------------------------------------------------------------------------------
/src/resources/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nICEnnnnnnnLee/AcFunDown/48bb354755074b5b51087dd12df0f501b5ca6434/src/resources/favicon.png
--------------------------------------------------------------------------------
/src/resources/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nICEnnnnnnnLee/AcFunDown/48bb354755074b5b51087dd12df0f501b5ca6434/src/resources/header.png
--------------------------------------------------------------------------------
/src/resources/title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nICEnnnnnnnLee/AcFunDown/48bb354755074b5b51087dd12df0f501b5ca6434/src/resources/title.png
--------------------------------------------------------------------------------
/src/resources/x.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nICEnnnnnnnLee/AcFunDown/48bb354755074b5b51087dd12df0f501b5ca6434/src/resources/x.jpg
--------------------------------------------------------------------------------
/src/resources/xh.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nICEnnnnnnnLee/AcFunDown/48bb354755074b5b51087dd12df0f501b5ca6434/src/resources/xh.jpg
--------------------------------------------------------------------------------