IPTV_Hit_V2_Fix@m3u.py

decoded code
mail@pastecode.io avatar
unknown
python
2 years ago
7.7 kB
73
Indexable
Never

import os,pip
import datetime,os
import socket,hashlib
import json,random,sys, time,re
try:
	import androidhelper as sl4a
	ad = sl4a.Android()
	ad.view('https://youtu.be/NFQOYauZzko')
except:pass
import subprocess
import pathlib
subprocess.run(["clear", ""])
try:
	import requests
except:
	print("requests modulu yüklü değil \n requests modulü yükleniyor \n")
	pip.main(['install', 'requests'])
import requests

try:
	import timedelta
except:
	print("datetime modulu yüklü değil \n timedelta modulü yükleniyor \n")
	pip.main(['install', 'timedelta'])
import timedelta

import logging
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS="TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:ECDHE:!COMP"
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
ses= requests.Session()
logging.captureWarnings(True)
subprocess.run(["clear", ""])
feyzo=("""
\33[1;30m▰▰▰▰ᴘʏᴛʜᴏɴ 🅵🅴🆈🆉🅾️ ▰▰▰▰▰▰▰       \33[1;34m            
     
╔══════════════════════════════════        
║████  ████ ██ ░░ ██ ██████ ░ ████ ░░░         
║██ ░░ ██ ░░ ██  ██ ░░░░ ██ ░██ ░ ██ ░░        
║████  ████ ░ ████ ░░░ ██ ░ ██ ░░░ ██ ░     
║██ ░░ ██ ░░░░ ██ ░░ ██ ░░░░ ██ ░ ██ ░░      
║██ ░░ ████ ░░ ██ ░░ ██████ ░ ████ ░░░        
╚══════════════════════════════════     )
              
\33[1;30m▰▰▰▰ \33[0;1;41m FreeIPTV    \33[40m M3U 🅵🅴🆈🆉🅾️     \33[1;30m ▰▰▰▰             \33[0;1m

""")
print(feyzo) 

gun=int(input("""
\33[1;41mTelegram= https://t.me/FeyzullahK
\33[0m\33[1m
Kaç günlük tarama yapılsın..?
Önerilen 5 gündür.

Cevabınız="""))
print('\n\n\n')

now = datetime.datetime.now()
#trh=(now.strftime("%D"))
Dosya="/sdcard/IptvHit_m3u_" +str(now.strftime("%D")).replace('/','-')+"@Feyzo.txt"
def Kaydet(hits):
    dosya=open(Dosya,'a+') 
    dosya.write(hits)
    dosya.close()    
#print(trh)

day_delta = datetime.timedelta(days=1)
basla = datetime.datetime.today()
bitir=basla-datetime.timedelta(days=int(gun))




Dosya="/sdcard/Freptv_m3u_" +str(now.strftime("%D")).replace('/','-')+"@Feyzo.txt"
def kaydet(hits):
    dosya=open(Dosya,'a+') 
    dosya.write(hits)
    dosya.close()    
    
m3us=""    
kate=""
hit=0
m3=0
#res = ses.get('http://iptvhit.com/freeiptv?24/08/2021',timeout=15, verify=False)
#veri=str(res.text)
#print(veri)

for x in range((basla-bitir).days):
	trh=(basla- x*day_delta)
	gun=trh.strftime("%d")
	ay=trh.strftime("%m")
	yil=trh.strftime("%Y")
	
	trh=(gun+'/'+ay+'/'+yil)
	
	#print(trh)
#	
	link="https://app.freeiptv.life/"+yil+"/"+ay+"/free-iptv-links-daily-updated-m3u-playlists-"+gun+".html?m=1"
	#print("https://app.freeiptv.life/2021/09/free-iptv-links-daily-updated-m3u-playlists-24.html?m=1")

	#print(link)
	#quit()
#	print('http://iptvhit.com/freeiptv?24/08/2021')
	try:
		res = ses.get(link,timeout=15, verify=False)
	except:pass
	veri=str(res.text)
#	print(veri)
#	print('http://iptvhit.com/freeiptv?24/08/2021')
	for i in veri.split('/http://'):
		m3u=('http://'+i.split('=m3u')[0]+'=m3u_plus')
		panel=(m3u.split('/')[2]+'/')
		user=(m3u.split('=')[1])
		pas=(m3u.split('=')[2])
		m3=int(m3)+1
		yazdir=("""🅵🅴🆈🆉🅾️     \33[1;41m Day """+str(trh)+""" \33[0m    \33[0;1;44m M3U-"""+str(m3)+""" \33[0m   \33[30;1;43m HITs-"""+str(hit)+""" \33[0m""")
		print(yazdir)
		
		HEADERd={
	"User-Agent":"Mozilla/5.0 (QtEmbedded; U; Linux; C) AppleWebKit/533.3 (KHTML, like Gecko) MAG200 stbapp ver: 4 rev: 2721 Mobile Safari/533.3" ,
	"Referer": "http://"+panel+"/c/" ,
	"Accept": "application/json,application/javascript,text/javascript,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" ,
	"Cookie": "stb_lang=en; timezone=Europe/Paris;",
	"Accept-Encoding": "gzip, deflate" ,
	"Connection": "Keep-Alive" ,
	"X-User-Agent":"Model: MAG254; Link: Ethernet",
	"Authorization": "Bearer ",
	            }
		
		url5="http://"+panel+"player_api.php?username="+user+"&password="+pas
		#print(url5)
		if not m3u in m3us:
			
	#	if 1==1:
				   	m3us= ', ' + m3u
				   	veri=""
				   	try:
				   	      if not m3u == "http:&password=&type=m3u_plus" :
				   	      	res = ses.get(url5, headers=HEADERd, timeout=15, verify=False)
				   	except:pass
				   	veri=str(res.text)
				   	if 'active_cons' in veri:
				   		hit=hit+1
				   		acon=""
				   		acon=veri.split('active_cons":')[1]
				   		acon=acon.split(',')[0]
				   		acon=acon.replace('"',"")
				   		mcon=veri.split('max_connections":')[1]
				   		mcon=mcon.split(',')[0]
				   		mcon=mcon.replace('"',"")
				   		status=veri.split('status":')[1]
				   		status=status.split(',')[0]
				   		status=status.replace('"',"")
				   		timezone=veri.split('timezone":"')[1]
				   		timezone=timezone.split('",')[0]
				   		timezone=timezone.replace("\/","/")
			   			if 1==1:
						   	realm=veri.split('url":')[1]
						   	realm=realm.split(',')[0]
						   	realm=realm.replace('"',"")
						   	portal=panel
						   	port=veri.split('port":')[1]
						   	port=port.split(',')[0]
						   	port=port.replace('"',"")
						   	
						   	
						   	userm=veri.split('username":')[1]
						   	userm=userm.split(',')[0]
						   	userm=userm.replace('"',"")
						   	passw=veri.split('password":')[1]
						   	passw=passw.split(',')[0]
						   	passw=passw.replace('"',"")
						   	bitis=veri.split('exp_date":')[1]
						   	bitis=bitis.split(',')[0]
						   	bitis=bitis.replace('"',"")
						   	if bitis=="null":
						   	      		bitis="Unlimited"
						   	else:
						   		bitis=(datetime.datetime.fromtimestamp(int(bitis)).strftime('%Y-%m-%d %H:%M:%S'))
						   	bitis=bitis
						   	mlink="http://"+ panel + "get.php?username=" + userm+ "&password=" + passw + "&type=m3u_plus"
						   	url="http://"+panel+"/player_api.php?username="+user+"&password="+pas+"&action=get_live_categories"
						   	try:
						   		res = ses.post(url,timeout=15, verify=False)
						   	except:pass
						   	veri=str(res.text)
						   	kate=""
						   	for i in veri.split('category_name":"'):
						   		kate=kate+" 💫 "+str((i.split('"')[0]).encode('utf-8').decode("unicode-escape")).replace('\/','/')
						   	
						   	
						   	
						   	mt=("""
╭─ᴘʏᴛʜᴏɴ ᴍᴏʙɪʟ ᴍ𝟹ᴜ ᴛᴀʀᴀᴍᴀ
├●🌐 Host ➤ http://"""+portal+"""
├●🌍 Real ➤ http://"""+realm+"""
├●📡 Port ➤ """+port+"""
├●👩‍ User ➤ """+userm+"""
├●🔑 Pass ➤ """+passw+"""
├●📆 Exp. ➤ """+bitis+""" 
├──── 🅵🅴🆈🆉🅾️
├●👩 Act Con ➤ """+acon+"""
├●👪 Max Con ➤ """+mcon+""" 
├●🌐 Status ➤ """+status+"""
├●⏰ TimeZone➤ """+timezone+"""""")
				
				    		
						   	mtl=("""
├●🔗m3u_Url➤"""+mlink+"""
├●💫 Kategori➤"""+kate+"""
▰▰ᴾʸᵗʰᵒⁿ ᴾʳᵒᵍʳᵃᵐᵐᵉʳ ᵇʸ ᶠᵉʸᶻᵒ▰▰
""")
						   	kod=str(mt+mtl)
						   #	kod=str(kod.decode('utf-8').decode("unicode-escape"))
						   	print(kod)
						   	kaydet(kod)
#	
#