Skip to content

Commit

Permalink
fix: database
Browse files Browse the repository at this point in the history
Update response.dev.js
Update request.dev.js
Update database.mjs
  • Loading branch information
VirgilClyne committed Dec 27, 2024
1 parent 2719f2e commit b4b778f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 37 deletions.
33 changes: 5 additions & 28 deletions src/function/database.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default {
{
title: "Apple TV+",
type: "Originals",
universalLinks: ["https://tv.apple.com/channel/tvs.sbd.4000", "https://tv.apple.com/atv"],
universalLinks: ["https://tv.apple.com/channel/tvs.sbd.4000", "https://tv.apple.com/atv", "https://tv.apple.com/originals"],
destinationType: "Target",
target: {
id: "tvs.sbd.4000",
Expand All @@ -60,7 +60,7 @@ export default {
},
},
{
title: "MLS Season Pass",
title: "MLS",
type: "MLS",
universalLinks: ["https://tv.apple.com/mls"],
destinationType: "Target",
Expand Down Expand Up @@ -117,32 +117,9 @@ export default {
{
title: "商店",
type: "Store",
universalLinks: ["https://tv.apple.com/store"],
destinationType: "SubTabs",
subTabs: [
{
title: "电影",
type: "Movies",
universalLinks: ["https://tv.apple.com/movies"],
destinationType: "Target",
target: {
id: "tahoma_movies",
type: "Root",
url: "https://tv.apple.com/movies",
},
},
{
title: "电视节目",
type: "TV",
universalLinks: ["https://tv.apple.com/tv-shows"],
destinationType: "Target",
target: {
id: "tahoma_tvshows",
type: "Root",
url: "https://tv.apple.com/tv-shows",
},
},
],
universalLinks: ["https://tv.apple.com/store", "https://tv.apple.com/movies", "https://tv.apple.com/tv-shows"],
destinationType: "Target",
target: { id: "tahoma_store", type: "Root", url: "https://tv.apple.com/store" },
},
{
title: "频道和 App",
Expand Down
18 changes: 9 additions & 9 deletions src/request.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ Console.info(`FORMAT: ${FORMAT}`);
const Version = Number.parseInt(url.searchParams.get("v"), 10),
Platform = url.searchParams.get("pfm"),
Caller = url.searchParams.get("caller");
Console.debug(`Version = ${Version}`, `Platform = ${Platform}`, `Caller = ${Caller}`);
Console.info(`Version: ${Version}`, `Platform: ${Platform}`, `Caller: ${Caller}`);
// 路径判断
switch (url.pathname) {
case "/uts/v3/configurations": {
Type = "Configs";
const Region = url.searchParams.get("region"),
Country = url.searchParams.get("country"),
StoreFrontH = url.searchParams.get("sfh");
Console.debug(`Region = ${Region}`, `Country = ${Country}`, `StoreFrontH = ${StoreFrontH}`);
Console.info(`Region: ${Region}`, `Country: ${Country}`, `StoreFrontH: ${StoreFrontH}`);
if (Settings.CountryCode[Type] !== "AUTO") {
if (Region) url.searchParams.set("region", Settings.CountryCode[Type] ?? Region);
if (Country) url.searchParams.set("country", Settings.CountryCode[Type] ?? Country);
Expand All @@ -165,7 +165,7 @@ Console.info(`FORMAT: ${FORMAT}`);
case "/uts/v3/canvases/roots/tahoma_watchnow":
case "/uts/v3/shelves/uts.col.UpNext":
Type = "WatchNow";
if (Settings.ThirdParty) url.searchParams.set("pfm", Platform === "desktop" ? "appletv" : Platform);
if (Settings.ThirdParty) if (Platform === "desktop") url.searchParams.set("pfm", "appletv");
break;
case "/uts/v3/canvases/Channels/tvs.sbd.4000":
case "/uts/v3/shelves/uts.col.ChannelUpNext.tvs.sbd.4000":
Expand Down Expand Up @@ -196,7 +196,7 @@ Console.info(`FORMAT: ${FORMAT}`);
case "/uts/v3/canvases/Rooms/edt.item.62327df1-6874-470e-98b2-a5bbeac509a2": // Friday Night Baseball - MLB - Apple TV+
Type = "Sports";
//if (Settings["ThirdParty"])
url.searchParams.set("pfm", Platform === "desktop" ? "ipad" : Platform);
if (Platform === "desktop") url.searchParams.set("pfm", "ipad");
break;
case "/uts/v3/canvases/Roots/kids":
Type = "Kids";
Expand All @@ -207,11 +207,11 @@ Console.info(`FORMAT: ${FORMAT}`);
break;
case "/uts/v3/canvases/Roots/movies":
Type = "Movies";
if (Settings.ThirdParty) url.searchParams.set("pfm", Platform === "desktop" ? "ipad" : Platform);
if (Settings.ThirdParty) if (Platform === "desktop") url.searchParams.set("pfm", "ipad");
break;
case "/uts/v3/canvases/Roots/tv":
Type = "TV";
if (Settings.ThirdParty) url.searchParams.set("pfm", Platform === "desktop" ? "ipad" : Platform);
if (Settings.ThirdParty) if (Platform === "desktop") url.searchParams.set("pfm", "ipad");
break;
case "/uts/v3/favorite-people":
case "/uts/v3/favorite-teams":
Expand All @@ -230,7 +230,7 @@ Console.info(`FORMAT: ${FORMAT}`);
case "/uts/v3/watchlist":
case "/uts/v2/watchlist/contains":
case "/uts/v2/watchlist/search":
if (Settings.ThirdParty) url.searchParams.set("pfm", Platform === "desktop" ? "ipad" : Platform);
if (Settings.ThirdParty) if (Platform === "desktop") url.searchParams.set("pfm", "ipad");
break;
default:
//if (Settings["ThirdParty"]) url.searchParams.set("pfm", (Platform === "desktop") ? "ipad" : Platform);
Expand All @@ -242,11 +242,11 @@ Console.info(`FORMAT: ${FORMAT}`);
else if (url.pathname.includes("/uts/v3/sporting-events/")) {
Type = "Sports";
//if (Settings["ThirdParty"])
url.searchParams.set("pfm", Platform === "desktop" ? "ipad" : Platform);
if (Platform === "desktop") url.searchParams.set("pfm", "ipad");
} else if (url.pathname.includes("/uts/v3/canvases/Sports/")) {
Type = "Sports";
//if (Settings["ThirdParty"])
url.searchParams.set("pfm", Platform === "desktop" ? "ipad" : Platform);
if (Platform === "desktop") url.searchParams.set("pfm", "ipad");
} else if (url.pathname.includes("/uts/v3/canvases/Persons/")) Type = "Persons";
else if (url.pathname.includes("/uts/v3/canvases/Rooms/")) Type = "Others";
//else if (url.pathname.includes("/uts/v3/playables/")) Type = "Others";
Expand Down
1 change: 1 addition & 0 deletions src/response.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Console.info(`FORMAT: ${FORMAT}`);
case "text/json":
case "application/json":
body = JSON.parse($response.body);
Console.debug(`body: ${JSON.stringify(body)}`);
// 主机判断
switch (url.hostname) {
case "uts-api.itunes.apple.com": {
Expand Down

0 comments on commit b4b778f

Please sign in to comment.