Skip to content

Commit

Permalink
added '/' in referrer
Browse files Browse the repository at this point in the history
  • Loading branch information
BeamlakAschalew committed Sep 21, 2024
1 parent 3a45f82 commit b319429
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/constants/api_constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ dotenv.config();

export const tmdbBaseUrl = "https://api.themoviedb.org";
export const tmdbKey = process.env.TMDB_KEY;
export const daddyliveReferrer = "https://lewblivehdplay.ru";
export const daddyliveUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36";
export const daddyliveStreamBaseUrl = "https://webhdrunns.onlinehdhls.ru/lb/premium"
export const daddyliveReferrer = "https://lewblivehdplay.ru/";
export const daddyliveUserAgent =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36";
export const daddyliveStreamBaseUrl =
"https://webhdrunns.onlinehdhls.ru/lb/premium";
export const daddyliveTrailingUrl = `/index.m3u8?|referer=${daddyliveReferrer}`;
export const daddylive247Url = "https://dlhd.so/24-7-channels.php";
export const daddylive247Url = "https://dlhd.so/24-7-channels.php";
20 changes: 16 additions & 4 deletions src/routes/daddylive.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { FastifyInstance } from "fastify";
import { get247 } from "../providers/daddylive";
import { daddyliveReferrer, daddyliveStreamBaseUrl, daddyliveTrailingUrl, daddyliveUserAgent } from "../constants/api_constants";
import {
daddyliveReferrer,
daddyliveStreamBaseUrl,
daddyliveTrailingUrl,
daddyliveUserAgent,
} from "../constants/api_constants";

const routes = async (fastify: FastifyInstance) => {
fastify.get("/", async (_, rp) => {

rp.status(200).send({
intro: "Welcome to the daddylive provider",
routes: "/live",
Expand All @@ -14,9 +18,17 @@ const routes = async (fastify: FastifyInstance) => {
fastify.get("/live", async (_, rp) => {
const channels = await get247();
if (channels) {
rp.status(200).send({base_url: daddyliveStreamBaseUrl, trailing_url: daddyliveTrailingUrl, referrer: daddyliveReferrer, user_agent: daddyliveUserAgent, channels: channels});
rp.status(200).send({
base_url: daddyliveStreamBaseUrl,
trailing_url: daddyliveTrailingUrl,
referrer: daddyliveReferrer,
user_agent: daddyliveUserAgent,
channels: channels,
});
} else {
rp.status(500).send({message: "Unknown error occured. Could not fetch channels"});
rp.status(500).send({
message: "Unknown error occured. Could not fetch channels",
});
}
});
};
Expand Down

0 comments on commit b319429

Please sign in to comment.