migliorato hdmario

This commit is contained in:
marco
2020-05-24 18:30:42 +02:00
parent b6856f9a8d
commit ee45b90c2a
2 changed files with 5 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
{
"active": false,
"active": true,
"find_videos": {
"ignore_urls": [],
"patterns": [

View File

@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
from threading import Thread
from core import httptools, scrapertools
from core import httptools, scrapertools, filetools
from platformcode import logger, config
from BaseHTTPServer import BaseHTTPRequestHandler
baseUrl = 'https://hdmario.live'
@@ -24,25 +22,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
secureProof = scrapertools.find_single_match(data, '\|(\w{22})\|')
logger.info('X-Secure-Proof=' + secureProof)
from BaseHTTPServer import HTTPServer
server = HTTPServer(('localhost', 9017), GetHandler)
Thread(target=server.serve_forever).start()
data = httptools.downloadpage(baseUrl + '/pl/' + page_url.split('/')[-1].replace('?', '') + '.m3u8', headers=[['X-Secure-Proof', secureProof]]).data
filetools.write('special://temp/hdmario.m3u8', data, 'w')
video_urls = [['.m3u8 [HDmario]', 'http://localhost:9017/master/' + page_url.split('/')[-1].replace('?', '')]]
video_urls = [['.m3u8 [HDmario]', 'special://temp/hdmario.m3u8']]
return video_urls
def shutdown():
import time
time.sleep(1)
server.shutdown()
class GetHandler(BaseHTTPRequestHandler):
def do_GET(self):
global secureProof
data = httptools.downloadpage(baseUrl + self.path, headers=[['X-Secure-Proof', secureProof]]).data
self.send_response(200)
self.end_headers()
self.wfile.write(data)
Thread(target=shutdown).start()
return