Skip to content

Instantly share code, notes, and snippets.

@gokaybiz
Last active March 7, 2024 08:51
Show Gist options
  • Save gokaybiz/84d957dcb07b6c5e03ae74c7bc6be4d5 to your computer and use it in GitHub Desktop.
Save gokaybiz/84d957dcb07b6c5e03ae74c7bc6be4d5 to your computer and use it in GitHub Desktop.
Clientless vavoo.tv ip tv
package main
import (
"bufio"
"encoding/json"
"errors"
"fmt"
"net/http"
"os"
"strings"
)
var signedKey string = ""
type playlist []struct {
Group string `json:"group"`
Logo string `json:"logo"`
Name string `json:"name"`
URL string `json:"url"`
}
func getGuest() (string, error) {
body := strings.NewReader(`{"platform": "Windows NT x86 32-bit","version": "2.2","service_version": "1.2.24","branch": "master"}`)
req, err := http.NewRequest("POST", "http://www.vavoo.tv/api/box/guest", body)
if err != nil {
return "", errors.New("Bir seyler ters gitti")
}
req.Header.Set("Connection", "keep-alive")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("User-Agent", "VAVOO/2.2")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return "", errors.New("Vavoo'ya baglanilamadi!")
}
defer resp.Body.Close()
dec := json.NewDecoder(resp.Body)
if dec == nil {
return "", errors.New("Vavoo'dan gelen veri hatali!")
}
jsonMap := make(map[string]interface{})
err = dec.Decode(&jsonMap)
if err != nil {
return "", errors.New("Json verisi bozuk!!!")
}
return jsonMap["response"].(map[string]interface{})["signed"].(string), nil
}
func generateChannelList() (string, error) {
var channels strings.Builder
resp, err := http.Get("https://vjackson.info/live/index?output=json&vavoo_auth")
if err != nil {
return "", errors.New("Vavoo'ya baglanilamadi!")
}
defer resp.Body.Close()
dec := json.NewDecoder(resp.Body)
if dec == nil {
return "", errors.New("Kanal listesi hatali!")
}
jsonMap := &playlist{}
err = dec.Decode(&jsonMap)
if err != nil {
return "", errors.New("Json verisi bozuk!!!")
}
channels.WriteString(`#EXTM3U
`)
for _, v := range *jsonMap {
if v.Group == "Turkey" {
channels.WriteString(`#EXTVLCOPT:http-user-agent=VAVOO/2.2
#EXTINF:-1 tvg-name="`)
channels.WriteString(v.Name)
channels.WriteString(`" group-title="Turkey",`)
channels.WriteString(v.Name)
channels.WriteString(`
`)
channels.WriteString(v.URL)
channels.WriteString("?n=1&b=4&vavoo_auth=")
channels.WriteString(signedKey)
channels.WriteString(`
`)
}
}
return channels.String(), nil
}
func main() {
var fileName, playlistData string = "vavoo-end.m3u", ""
var err error
signedKey, err = getGuest()
if err != nil {
fmt.Println(err)
return
}
playlistData, err = generateChannelList()
if err != nil {
fmt.Println(err)
return
}
file, err := os.Create(fileName)
if err != nil {
fmt.Println("Liste olusturulamadi!")
file.Close()
return
}
_, err = file.WriteString(playlistData)
if err != nil {
fmt.Println(err)
file.Close()
return
}
file.Close()
fmt.Println("Playlist basariyla olusturuldu!\r\nCikmak icin enter tusuna dokun.")
scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() {
os.Exit(0)
}
}
@ersinkhr
Copy link

ersinkhr commented Apr 7, 2022

Hi Gökay,

When I am researching about this problem, I faced your gist :) I know, there is a long time passed, but I created a token without success :( token does not work and also they are now using https protocol right now.

However, generating channel links works very well.

If you have an update about generating token, could you update this git to help me? And also I am researching a solution about this situation. If I find any solution about this, I will directly inform you :)

Thanks,

Görüşmek üzere 🚨

@dursuntokgoz
Copy link

Hi @gokaybiz ,
I request an update on the subject.
Thanks,

Güncelleme yaparsanız çok seviniriz.

@frd59
Copy link

frd59 commented May 3, 2022

merhaba @ersinkhr
Bir güncelleme bulabildinizmi acaba ?

@gokaybiz
Copy link
Author

gokaybiz commented May 3, 2022

I'm not interested with ip tv services for a long time.
I don't think there is a free trial exist anymore. You can get channel list by this payload but probably token won't work because of that.
If I have free-time I'll check but I don't think there is a way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment