Refresh libraries
This commit is contained in:
1 parent
9024afed19
commit
f4de403cdd
3 files changed
+11
-11
No files matched your search
@@ -12,17 +12,17 @@ default-features = false
|
||||
features = ["std", "perf", "unicode-perl"]
|
||||
|
||||
[dependencies]
|
||||
tl = "*"
|
||||
log = "*"
|
||||
android_logger = "*"
|
||||
apply = "*"
|
||||
once_cell = "*"
|
||||
quick-xml = "*"
|
||||
jnix = { path = "jnix" }
|
||||
jnix-macros = "*"
|
||||
catch_panic = { path = "catch_panic" }
|
||||
catch_panic_macros = { path = "catch_panic_macros" }
|
||||
jni_fn = { path = "jni_fn" }
|
||||
html-escape = "0.2.13"
|
||||
tl = "0.7.7"
|
||||
log = "0.4.19"
|
||||
android_logger = "0.13.1"
|
||||
apply = "0.3.0"
|
||||
once_cell = "1.18.0"
|
||||
|
||||
[profile.release]
|
||||
strip = true
|
||||
|
||||
@@ -3,18 +3,19 @@ mod parser;
|
||||
extern crate android_logger;
|
||||
extern crate apply;
|
||||
extern crate catch_panic;
|
||||
extern crate html_escape;
|
||||
extern crate jni_fn;
|
||||
extern crate jnix;
|
||||
extern crate jnix_macros;
|
||||
extern crate log;
|
||||
extern crate once_cell;
|
||||
extern crate quick_xml;
|
||||
extern crate regex;
|
||||
extern crate tl;
|
||||
|
||||
use android_logger::Config;
|
||||
use apply::Also;
|
||||
use catch_panic::catch_panic;
|
||||
use html_escape::decode_html_entities;
|
||||
use jni_fn::jni_fn;
|
||||
use jnix::jni::objects::{JClass, JString};
|
||||
use jnix::jni::sys::{jint, jintArray, jobject, jobjectArray, JavaVM, JNI_VERSION_1_6};
|
||||
@@ -22,7 +23,6 @@ use jnix::jni::JNIEnv;
|
||||
use jnix::{IntoJava, JnixEnv};
|
||||
use jnix_macros::IntoJava;
|
||||
use log::{error, LevelFilter};
|
||||
use quick_xml::escape::unescape;
|
||||
use std::ffi::c_void;
|
||||
use tl::{Node, Parser, VDom};
|
||||
|
||||
@@ -102,7 +102,7 @@ pub fn parseFav(env: JNIEnv, _class: JClass, input: JString, str: jobjectArray)
|
||||
let top = e.get(parser)?.children()?;
|
||||
let children = top.top();
|
||||
let cat = children[5].get(parser)?.inner_text(parser);
|
||||
let name = unescape(&cat).ok()?;
|
||||
let name = decode_html_entities(&cat);
|
||||
env.set_object_array_element(str, i as i32, env.new_string(name.trim()).ok()?)
|
||||
.ok()?;
|
||||
Some(
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use catch_panic::catch_panic;
|
||||
use html_escape::decode_html_entities;
|
||||
use jni_fn::jni_fn;
|
||||
use jnix::jni::objects::{JClass, JString};
|
||||
use jnix::jni::sys::jobject;
|
||||
use jnix::jni::JNIEnv;
|
||||
use jnix::{IntoJava, JnixEnv};
|
||||
use jnix_macros::IntoJava;
|
||||
use quick_xml::escape::unescape;
|
||||
use {parse_jni_string, regex};
|
||||
|
||||
#[derive(Default, IntoJava)]
|
||||
@@ -38,7 +38,7 @@ pub fn parseTorrent(env: JNIEnv, _class: JClass, input: JString) -> jobject {
|
||||
let html = e.get(parser)?.inner_html(parser);
|
||||
let reg = regex!("</span> ([0-9-]+) [0-9:]+</td>[\\s\\S]+</span> ([0-9.]+ [KMGT]B)</td>[\\s\\S]+</span> ([0-9]+)</td>[\\s\\S]+</span> ([0-9]+)</td>[\\s\\S]+</span> ([0-9]+)</td>[\\s\\S]+</span>([^<]+)</td>[\\s\\S]+onclick=\"document.location='([^\"]+)'[^<]+>([^<]+)</a>");
|
||||
let grp = reg.captures(&html)?;
|
||||
let name = unescape(&grp[8]).ok()?;
|
||||
let name = decode_html_entities(&grp[8]);
|
||||
Some(Torrent {
|
||||
posted: grp[1].to_string(),
|
||||
size: grp[2].to_string(),
|
||||
|
||||
Reference in new issue
Block a user