问题描述
在Android手机上使用Lua脚本成功下载mp4文件后,系统视频检测不到1.mp4文件,TikTok也找不到视频发布.
After successfully downloading the mp4 file using the Lua script on the Android phone, the system Videos cannot detect the 1.mp4 file, and the video cannot be found in TikTok to publish.
我使用脚本下载了 1.mp4.
I downloaded 1.mp4 using a script.
我手动复制了 1.mp4 变成了 copy.mp4.
I manually copied 1.mp4 to become copy.mp4.
抖音检测不到1.mp4
1.mp4 cannot be detected by tiktok
copy.mp4 可以被抖音检测到
copy.mp4 can be detected by tiktok
两个文件都没有隐藏
我检查了两个文件的权限:
I checked the permissions of two files :
-rw-rw---- root sdcard_ rw 6939904 2020-11-12 22:07 1. mp4
-rw-rw---- root sdcard_ rw 6939904 2020-11-12 22:15 copy. mp4
不知道为什么找不到1.mp4
I don’t know why 1.mp4 is not found
有没有办法让抖音(其他应用)识别1.mp4
Is there any way to make tiktok(Other apps) recognize 1.mp4
我的代码:
local http = require("socket.http")
severfileTXTpath = "https://ttmakemoney.oss-cn-hangzhou.aliyuncs.com/1.mp4"
localfileTXTpath = "/sdcard/Download/aliyunPZ/1/1.mp4"
local body, code = http.request(severfileTXTpath)
if not body then error(code) end
local f = assert(io.open(localfileTXTpath, 'wb'))
f:write(body)
f:close()
通过图片可以看到效果
Setelah salinan yang berjaya gagal,系统视频 Android tidak dapat mengesan 视频 copy.mp4,dan juga tidak dapat mencari video copy.mp4 yang akan diterbitkan di TikTok.
Setelah salinan yang berjaya gagal, sistem video Android tidak dapat mengesan video copy.mp4,dan juga tidak dapat mencari video copy.mp4 yang akan diterbitkan di TikTok.
local ts = require("ts")
path1 = "/sdcard/Download/aliyunPZ/1/copy.mp4"
path2 = "/sdcard/Download/aliyunPZ/1/1.mp4"
os.execute("cp " ..path1.. " "..path2)
1.mp4 可以通过抖音检测
1.mp4 can be detected by tiktok
抖音检测不到copy.mp4
copy.mp4 cannot be detected by tiktok
不知道怎么回事?
我检查了两个文件(adb)的权限:
I checked the permissions of two files (adb):
-rw-rw---- root sdcard_rw 6939904 2020-11-13 20:21 1. mp4
-rw-rw---- root sdcard_rw 6939904 2020-11-14 1:54 copy. mp4
通过图片可以看到效果
推荐答案
I think "body"在您的脚本中实际上是正常状态";被退回.此外,您尝试使用 http 打开 https 套接字.这应该可以,只需更改 URL 和路径即可.
I think "body" in your script is actually the "OK status" being returned. Also, you attempting to open an https socket with http. This should do, just change URL and path.
#! /usr/bin/env lua
-- luarocks install luasocket
-- luarocks install luasec
-- local http = require( 'socket.http' )
local https = require( 'ssl.https' )
local ltn12 = require( 'ltn12' )
local URL = "https://raw.githubusercontent.com/doyousketch2/the3dPen/master/icon.png"
local path = "/home/sketch2/Downloads/icon.png"
local oput = io.open( path, 'wb' )
local ok, code, headers, text = https .request { url = URL, sink = ltn12.sink.file( oput ) }
print( 'ok:', ok )
print( 'code:', code, text )
if headers then
print( 'headers:' )
for i, v in pairs( headers ) do
print( ' ' ..i ..':', v )
end
end
基于 -- https://gist.github.com/Core-commits/0eaaa00eac5e89e68631fedd72831675
luasec 类似于 luasocket,但允许 https 连接.
luasec is similar to luasocket, but allows https connections.
http://w3.impa.br/~diego/software/luasocket/http.html
http://w3.impa.br/~diego/software/luasocket/ltn12.html
这篇关于我使用 Lua 脚本下载了 mp4 文件,但 TikTok(其他应用程序)找不到视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!