Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
f19ea393
Commit
f19ea393
authored
Sep 11, 2019
by
Him188moe
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
8782689a
79f7cd62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
mirai-core/pom.xml
mirai-core/pom.xml
+6
-0
mirai-core/src/main/java/net/mamoe/mirai/utils/ImageNetworkUtils.java
...rc/main/java/net/mamoe/mirai/utils/ImageNetworkUtils.java
+36
-0
No files found.
mirai-core/pom.xml
View file @
f19ea393
...
@@ -53,6 +53,12 @@
...
@@ -53,6 +53,12 @@
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.jsoup
</groupId>
<artifactId>
jsoup
</artifactId>
<version>
1.12.1
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
mirai-core/src/main/java/net/mamoe/mirai/utils/ImageNetworkUtils.java
0 → 100644
View file @
f19ea393
package
net.mamoe.mirai.utils
;
import
org.jsoup.Connection
;
import
org.jsoup.Jsoup
;
import
java.io.IOException
;
public
class
ImageNetworkUtils
{
public
static
void
postImage
(
String
ukey
,
int
fileSize
,
String
g_uin
,
String
groupCode
,
String
img
){
//http://htdata2.qq.com/cgi-bin/httpconn?htcmd=0x6ff0071&ver=5515&term=pc&ukey=” + 删全部空 (ukey) + “&filesize=” + 到文本 (fileSize) + “&range=0&uin=” + g_uin + “&groupcode=” + Group
StringBuilder
builder
=
new
StringBuilder
(
"http://htdata2.qq.com/cgi-bin/httpconn?htcmd=0x6ff0071&ver=5515&term=pc"
);
builder
.
append
(
"&ukey="
)
.
append
(
ukey
.
trim
())
.
append
(
"&filezise="
).
append
(
fileSize
)
.
append
(
"&range="
).
append
(
"0"
)
.
append
(
"&uin="
).
append
(
g_uin
)
.
append
(
"&groupcode="
).
append
(
groupCode
);
try
{
Connection
.
Response
response
=
Jsoup
.
connect
(
builder
.
toString
())
.
ignoreContentType
(
true
)
.
requestBody
(
img
)
.
followRedirects
(
true
)
.
userAgent
(
"QQClient"
)
.
header
(
"Content-Length"
,
""
+
fileSize
)
.
execute
();
System
.
out
.
println
(
response
.
statusCode
());
System
.
out
.
println
(
response
.
statusMessage
());
System
.
out
.
println
(
response
.
body
());
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment