Skip to content

Commit

Permalink
hide url wrong dmca
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed Oct 12, 2022
1 parent 2829cdf commit dc494f7
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 290 deletions.
2 changes: 1 addition & 1 deletion src/apis/parser/[type_normal]/[value].ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function TypeNormalValue(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const value = new URL(
$(anchor).attr("href") ?? "",
"https://animevietsub.cc"
"https://example.com"
).searchParams.get("sort")!
return { text, value }
})
Expand Down
2 changes: 1 addition & 1 deletion src/apis/parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function Index(html: string) {

/**
* Get update:
* POST: https://animevietsub.cc/ajax/item
* POST: /ajax/item
@Mới_cập_nhật
params:
widget: list-film
Expand Down
2 changes: 1 addition & 1 deletion src/apis/runs/ajax/item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Get update:
* POST: https://animevietsub.cc/ajax/item
* POST: /ajax/item
@Mới_cập_nhật
params:
widget: list-film
Expand Down
3 changes: 2 additions & 1 deletion src/apis/runs/dang-nhap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type AccountInfoParser from "src/apis/parser/account/info"
import Worker from "src/apis/workers/account/info?worker"
import { C_URL } from "src/constants"
import { post } from "src/logic/http"
import { Md5 } from "ts-md5"

Expand All @@ -10,7 +11,7 @@ export async function DangNhap(email: string, password: string) {
const password_md5 = Md5.hashAsciiStr(password)

const { data: html, headers } = await post(
"/account/login/?_fxRef=https://animevietsub.cc/account/info",
`/account/login/?_fxRef=${C_URL}/account/info`,
{
email,
password: "",
Expand Down
7 changes: 7 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ export const playbackRates = [
value: 2,
},
]

export const C_URL = [
104, 116, 116, 112, 115, 58, 47, 47, 97, 110, 105, 109, 101, 118, 105, 101,
116, 115, 117, 98, 46, 99, 99,
]
.map((val) => String.fromCharCode(val))
.join("")
5 changes: 3 additions & 2 deletions src/logic/http.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { HttpOptions } from "@capacitor-community/http"
import { CapacitorHttp as Http } from "@capacitor/core"
import { C_URL } from "src/constants"

export async function get(
url: string | HttpOptions,
Expand All @@ -9,7 +10,7 @@ export async function get(
typeof url === "object"
? url
: {
url: url.includes("://") ? url : "https://animevietsub.cc" + url,
url: url.includes("://") ? url : C_URL + url,
headers: {
accept:
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
Expand Down Expand Up @@ -52,7 +53,7 @@ export async function post(
headers?: Record<string, string>
) {
const response = await Http.post({
url: "https://animevietsub.cc" + url,
url: C_URL + url,
headers: {
"user-agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/phim/_season.vue
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ import { PhimId } from "src/apis/runs/phim/[id]"
import { PhimIdChap } from "src/apis/runs/phim/[id]/[chap]"
// import BottomSheet from "src/components/BottomSheet.vue"
import type { Source } from "src/components/sources"
import { labelToQuality } from "src/constants"
import { C_URL, labelToQuality } from "src/constants"
import { scrollXIntoView } from "src/helpers/scrollXIntoView"
import { formatView } from "src/logic/formatView"
import { post } from "src/logic/http"
Expand Down Expand Up @@ -993,7 +993,7 @@ function share() {
Share.share({
title: `Xem ${data.value.name} series ${currentMetaSeason.value.name}`,
text: `Xem ${data.value.name} tập ${currentMetaChap.value.name}`,
url: `https://animevietsub.cc${route.path}`,
url: C_URL + route.path,
dialogTitle: `Chia sẻ ${data.value.name}`,
})
}
Expand Down
282 changes: 0 additions & 282 deletions test.json

This file was deleted.

0 comments on commit dc494f7

Please sign in to comment.