Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好。请教一下tvbox js一些问题 #47

Closed
fdsa123q opened this issue Apr 14, 2024 · 6 comments
Closed

你好。请教一下tvbox js一些问题 #47

fdsa123q opened this issue Apr 14, 2024 · 6 comments
Assignees
Labels
bug Something isn't working question Further information is requested 新源 增加新的源

Comments

@fdsa123q
Copy link

提交post,字符串带换行符号
例如:params='ABC\nEFG';
我抓包真实发送却是"ABC\nEFG" 带引号而且\n没直接展示换行
正确的发送数据是:
ABC
EFG

@jadehh
Copy link
Owner

jadehh commented Apr 14, 2024

JS中有特殊符号要用\, 如 "ABC\\nEFG", Post请求具体要看请求体格式

 if (postType == 'form') 
  {
     headers['Content-Type'] = 'application/x-www-form-urlencoded';
     if (data != null) {
       data = qs.stringify(data, {encode: false});
       }
     } 
       else if (postType == 'form-data') {
         headers['Content-Type'] = 'multipart/form-data';
         data = toFormData(data);
  }

@fdsa123q
Copy link
Author

附上源码。如果可以麻烦看下。里面的CatVodOpen能正常运行
外面的tvbox 提交就出现我说的。\n也没用。播放端是fongmi的TVbox
tiantian.zip

@jadehh jadehh self-assigned this Apr 15, 2024
@jadehh jadehh added the 新源 增加新的源 label Apr 15, 2024
@jadehh
Copy link
Owner

jadehh commented Apr 15, 2024

TV无法正常运行具体是哪个接口没法用还是说所有接口都没法用

@fdsa123q
Copy link
Author

所有接口post的数据。会带双引号发送出去换行符没用。协议头已经添加了。也不知道是不是tvbox的bug还是我没写正确

@jadehh jadehh added bug Something isn't working question Further information is requested labels Apr 15, 2024
@fdsa123q
Copy link
Author

自行解决了,
method: get ? 'get' : 'post',
headers: headers,
body: p, 改body:p

@jadehh
Copy link
Owner

jadehh commented Apr 15, 2024

好的,建议还是TV和CatVodOpen用一份代码,不然维护成本太大。

@jadehh jadehh closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested 新源 增加新的源
Projects
None yet
Development

No branches or pull requests

2 participants