Fix Vidto.me

This commit is contained in:
Alhaziel01
2020-06-22 17:25:40 +02:00
parent 72068dcda9
commit 714381884f
2 changed files with 76 additions and 0 deletions

45
servers/vidtome.json Normal file
View File

@@ -0,0 +1,45 @@
{
"active": true,
"find_videos": {
"ignore_urls": [],
"patterns": [
{
"pattern": "(?:vidtome.stream|vidto.me)/(?!api)(?:embed-)?([A-z0-9]+)",
"url": "http://vidtome.stream/\\1.html"
},
{
"pattern": "vidtome.stream/api/fastredirect/streaming\\.php\\?file_real=([A-z0-9]+)",
"url": "http://vidtome.stream/api/fastredirect/streaming.php?file_real=\\1"
}
]
},
"free": true,
"id": "vidtome",
"name": "Vidto.me",
"settings": [
{
"default": false,
"enabled": true,
"id": "black_list",
"label": "@60654",
"type": "bool",
"visible": true
},
{
"default": 0,
"enabled": true,
"id": "favorites_servers_list",
"label": "@60655",
"lvalues": [
"No",
"1",
"2",
"3",
"4",
"5"
],
"type": "list",
"visible": false
}
]
}

31
servers/vidtome.py Normal file
View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
from core import httptools, scrapertools
from platformcode import logger, config
from lib import jsunpack
def test_video_exists(page_url):
logger.info("(page_url='%s')" % page_url)
global data
data = httptools.downloadpage(page_url).data
if "Not Found" in data or "File Does not Exist" in data:
return False, config.get_localized_string(70292) % 'Vidto.me'
return True, ""
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.info("url=" + page_url)
global data
video_urls = []
code = scrapertools.find_single_match(data, 'name="code" value="([^"]+)')
hash = scrapertools.find_single_match(data, 'name="hash" value="([^"]+)')
post = "op=download1&code=%s&hash=%s&imhuman=Proceed+to+video" %(code, hash)
data = httptools.downloadpage("http://vidtome.co/playvideos/%s" %code, post=post).data
packed = scrapertools.find_multiple_matches(data, r'(eval\s?\(function\(p,a,c,k,e,d\).*?\n)')
for p in packed:
data = jsunpack.unpack(p)
media_url = scrapertools.find_single_match(data, r"source:\\'([^\\']+)")
if media_url:
video_urls.append([media_url.split('.')[-1] + ' [Vidto.me]', media_url])
return video_urls