opt: up主投稿跳转番剧

This commit is contained in:
guozhigq
2024-05-02 23:33:58 +08:00
parent d8e647097d
commit 35a453aba7
5 changed files with 35 additions and 25 deletions

View File

@ -16,7 +16,7 @@ class UrlUtils {
};
try {
final response = await dio.get(url);
if (response.statusCode == 302) {
if (response.statusCode == 302 || response.statusCode == 301) {
redirectUrl = response.headers['location']?.first as String;
if (redirectUrl.endsWith('/')) {
redirectUrl = redirectUrl.substring(0, redirectUrl.length - 1);