Skip to content

Instantly share code, notes, and snippets.

@andruu
Last active December 24, 2020 22:22
Show Gist options
  • Save andruu/977c5947e76b78b3a0ad317273c7cfce to your computer and use it in GitHub Desktop.
Save andruu/977c5947e76b78b3a0ad317273c7cfce to your computer and use it in GitHub Desktop.
import axios from 'axios';
export interface ApiInput {
url: string;
username: string;
password: string;
type?: string;
output?: string;
}
export function fetchM3U(input: ApiInput) {
const {
username,
password,
url,
type = 'm3u_plus',
output = 'mpegts'
} = input;
return axios.get<string>(`${url}/get.php?`, {
params: { username, password, type, output }
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment