Sfoglia il codice sorgente

piconas apakšfolderī

run (pikonas, tmp)
filmix search
viaplay search/sort
Ivars 7 anni fa
parent
commit
1b0684e478

BIN
picons/al.jpg Vedi File


BIN
picons/art-default.jpg Vedi File


BIN
picons/back.png Vedi File


BIN
picons/cinemalive.png Vedi File


BIN
picons/euronews.png Vedi File


BIN
picons/filmas.png Vedi File


BIN
picons/filmix.png Vedi File


BIN
picons/filmon.png Vedi File


BIN
picons/folder.png Vedi File


BIN
picons/folder2.png Vedi File


BIN
picons/folder_search.png Vedi File


BIN
picons/icon-default.png Vedi File


BIN
picons/iplayer.png Vedi File


BIN
picons/latvia1.png Vedi File


BIN
picons/latvia7.png Vedi File


BIN
picons/lmt.jpg Vedi File


BIN
picons/lmt.png Vedi File


BIN
picons/lr_1_lv.png Vedi File


BIN
picons/lr_2_lv.png Vedi File


BIN
picons/lr_3_lv.png Vedi File


BIN
picons/movieplace.png Vedi File


BIN
picons/my_archive.png Vedi File


BIN
picons/my_kids.png Vedi File


BIN
picons/my_radio.png Vedi File


BIN
picons/my_tv.png Vedi File


BIN
picons/my_video.png Vedi File


BIN
picons/prefs.png Vedi File


BIN
picons/replay.png Vedi File


BIN
picons/riga24.png Vedi File


BIN
picons/shortcut.png Vedi File


BIN
picons/skaties.png Vedi File


BIN
picons/tvdom.png Vedi File


BIN
picons/tvplay.png Vedi File


BIN
picons/ustvnow.png Vedi File


BIN
picons/viaplay.jpg Vedi File


BIN
picons/viaplay.png Vedi File


BIN
picons/video.png Vedi File


+ 421
- 319
project.wpr
File diff soppresso perché troppo grande
Vedi File


+ 22
- 12
resolvers/cloudsany.py Vedi File

@@ -41,7 +41,7 @@ def resolve(url):
41 41
     m = re.search('cloudsany\.\w+/i/(\w+)', url)
42 42
     if not m:
43 43
         return stream
44
-    vid=m.group(1)
44
+    vid = str(m.group(1))
45 45
 
46 46
     r = requests.get(url, headers=headers)
47 47
     if r.status_code <> 200:
@@ -57,26 +57,36 @@ def resolve(url):
57 57
 
58 58
 
59 59
     # Subtitles #
60
-    sub = {}
60
+    subs = []
61
+    # https://cloudsany.com/subtitles/0w3y7su4c2ko.srt
62
+    # Latvian|label|srt|subtitles
63
+    #url_sub = "https://cloudsany.com/subtitles/%s.%s" % (vid, "srt")
64
+    url_sub = "https://cloudsany.com/subtitles/%s.srt" % vid
65
+    r2 = requests.head(url_sub)
61 66
     m = re.search(r"(\w+)\|label\|(\w+)\|(\w+)\|subtitles", p0)
62
-    if m:
63
-        url_sub = "https://cloudsany.com/subtitles/%s.%s" % (m.group(3), m.group(2))
67
+    if r2.status_code == 200 and m:
68
+        sub = {}
69
+        #url_sub = "https://cloudsany.com/subtitles/%s.%s" % (vid, "srt")
64 70
         url_title = m.group(1)
65 71
         print url_title
66 72
         sub["url"] = url_sub
67 73
         sub["lang"] = m.group(1)
68 74
         sub["name"] = m.group(1)
69
-        sub["type"] = "srt"
75
+        sub["type"] = m.group(2)
76
+        subs = [sub]
70 77
 
71 78
     # Stream URL
72
-    m = re.search(r"tracks\|(\w+)\|(\w+)\|(\w+)\|files\|(\w+)\|(\w+)\|(\w+)", p0)
73
-    if not m:
79
+    # co|sanii|dl1|file
80
+    m1 = re.search("\|(co)\|(\w+)\|(\w+)\|", p0)
81
+    # tracks|mp4|video|ut4dluxu56tyll|files
82
+    m2 = re.search(r"tracks\|(\w+)\|(\w+)\|(\w+)\|files", p0)
83
+    # 0://c.b.a/1t/6/1s/1r.1q
84
+    m3 = re.search(r"0://\w+\.\w+\.\w+/\w+/(\d+)/", r)
85
+    if not (m1 and m2 and m3):
74 86
         raise Exception("Can not find stream url")
75
-    #https://dl4.sanii.co/files/8/80mbh8zjyuh61n/video.mp4
76
-    # 0://1v.1u.1t/1s/2/1r/1q.1p
77
-    num = re.search(r"0://1\w\.1\w\.1\w/1\w/(\d+)", r).group(1)
87
+    # https://dl1.sanii.co/files/6/ut4dluxu56tyll/video.mp4
78 88
     url = "https://%s.%s.%s/files/%s/%s/%s.%s" % (
79
-        m.group(6), m.group(5), m.group(4), num, m.group(3), m.group(2), m.group(1))
89
+        m1.group(3), m1.group(2), m1.group(1), m3.group(1), m2.group(3), m2.group(2), m2.group(1))
80 90
     print url
81 91
 
82 92
     s = util.item()
@@ -84,7 +94,7 @@ def resolve(url):
84 94
     s["type"] = util.stream_type(s["url"])
85 95
     s["resolver"] = __name__
86 96
     #s["lang"] = lang
87
-    s["subs"] = [sub]
97
+    s["subs"] = subs
88 98
     s["name"] = url
89 99
     return [s]
90 100
 

+ 6
- 4
run.py Vedi File

@@ -11,7 +11,7 @@ import tkSimpleDialog as tkd
11 11
 
12 12
 import PIL, StringIO
13 13
 from PIL import ImageTk, Image
14
-import requests, urllib2
14
+import requests, urllib2, tempfile
15 15
 
16 16
 from ContentSources import ContentSources
17 17
 from sources.SourceBase import stream_type
@@ -36,8 +36,9 @@ class Main(Frame):
36 36
             self.sources = sources
37 37
         else:
38 38
             self.sources = ContentSources("sources", cfg_file)
39
-        self.picons_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "picons")
40
-        self.tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "tmp")
39
+        self.picons_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "picons")
40
+        #self.tmp_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "tmp")
41
+        self.tmp_path = os.path.join(tempfile.gettempdir(), "playstream")
41 42
         if not os.path.exists(self.tmp_path):
42 43
             os.mkdir(self.tmp_path)
43 44
         self.history = []
@@ -125,7 +126,7 @@ class Main(Frame):
125 126
             if not self.sources.is_video(data):
126 127
                 if "{0}" in data:
127 128
                     a = tkd.askstring("Search", "Search for")
128
-                    cur2 = (cur2[0],cur2[1].format(a),cur2[2],cur2[3])
129
+                    cur2 = (cur2[0],cur2[1].format(a.encode("utf8")),cur2[2],cur2[3])
129 130
                 self.history.append((self.cur, cs))
130 131
                 self.cur = self.content[cs]
131 132
                 self.cur_index = 0
@@ -466,6 +467,7 @@ class VideoInfo(tkd.Dialog):
466 467
             self.listbox2.pack(side=LEFT, fill=BOTH, expand=1)
467 468
             scrollbar3.pack(side=LEFT, fill=Y)
468 469
             for i,s in enumerate(self.subs):
470
+                if not len(s):continue
469 471
                 item = ("%s - %s"%(s["lang"],s["name"])).encode("utf8")
470 472
                 self.listbox2.insert(END, item)
471 473
             #self.listbox2.bind('<Double-1> ', self.list_select)

+ 11
- 7
sources/filmix.py Vedi File

@@ -73,15 +73,19 @@ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
73 73
             if len(plist) < 2:
74 74
                 return content
75 75
             import requests
76
-            ses = requests.session()
77
-            r = ses.get(self.url+data)
76
+            #ses = requests.session()
77
+            r = requests.get(self.url+data)
78
+            cookie = r.cookies["FILMIXNET"]
78 79
             url = "https://filmix.me/engine/ajax/sphinx_search.php"
79 80
             headers = headers2dict("""
80
-                User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
81
-                Content-Type: application/x-www-form-urlencoded; charset=UTF-8
82
-            """)
83
-            data = "scf=fx&story=%s&search_start=0&do=search&subaction=search" % (plist[1].replace(" ", "+"))
84
-            r = ses.post(url, data, headers=headers)
81
+User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
82
+X-Requested-With: XMLHttpRequest
83
+Content-Type: application/x-www-form-urlencoded; charset=UTF-8
84
+Cookie: FILMIXNET=%s
85
+"""% cookie)
86
+            #data = "scf=fx&story=%s&search_start=0&do=search&subaction=search" % (plist[1].replace(" ", "+"))
87
+            data = "sdc=fx&story=%s&do=search&subaction=search"% (plist[1].replace(" ", "+"))
88
+            r = requests.post(url, data, headers=headers)
85 89
             #r = r.content.decode("cp1251").encode("utf8")
86 90
             content = self.process_list(r.content, content)
87 91
             return content

+ 16
- 15
sources/ltc.py Vedi File

@@ -81,11 +81,12 @@ Accept-Language: en-US,en;q=0.8
81 81
 
82 82
         if clist=="home":
83 83
             content.extend([
84
-                ("Search TV", "ltc::search/{0}","","Search in TV archive"),
85
-                ("Search Video", "ltc::viss/search/?cat=movies&q={0}","","Search in video"),
86
-                ("Live streams", "ltc::tiesraide","","TV live streams"),
87
-                ("Archive", "ltc::arhivs","","TV live archive"),
88
-                ("Video", "ltc::videonoma","","Video on demand"),
84
+                #("Meklēt TV arhīvā", "ltc::search/{0}","","Meklēt TV arhīvā"), #TODO
85
+                ("Meklēt filmas", "ltc::viss/search/?cat=movies&q={0}","","Meklēt filmu sadaļā"),
86
+                ("Meklēt seriālus", "ltc::viss/search/?cat=series&q={0}","","Meklēt seriālu sadaļā"),
87
+                ("TV tiešraides", "ltc::tiesraide","","TV tiesraides"),
88
+                ("TV arhīvs", "ltc::arhivs","","TV arhīvs atseviškiem kanāliem"),
89
+                ("Videonoma", "ltc::videonoma","","Filmas (ari Priemiere) un seriāli"),
89 90
             ])
90 91
             return content
91 92
 
@@ -99,17 +100,17 @@ Accept-Language: en-US,en;q=0.8
99 100
             r = self.call2(data)
100 101
             if "cat=movies" in data:
101 102
                 result = re.findall('class="forward-link" href="/([^"]+)">(<div class="new-movie">Premiere</div>)*<img src="([^"]+)".+?class="categorie-one-title">([^<]+)<', r, re.MULTILINE)
102
-                for item in result:
103
-                    title = item[3]
104
-                    if not item[1]:
105
-                        title = title + "[P]"
106
-                    data2 = item[0][0:-1]
107
-                    img = "https://www.shortcut.lv" + item[2]
108
-                    desc = title
109
-                    content.append((title,self.name+"::"+data2,img,desc))
110
-                return content
111 103
             else:
112
-                return content
104
+                result = re.findall('class="forward-link" href="/([^"]+)">(<div class="new-movie">Premiere</div>)*<img src="([^"]+)".+?class="categorie-one-title">([^<]+)<', r, re.MULTILINE)
105
+            for item in result:
106
+                title = item[3]
107
+                if not item[1]:
108
+                    title = title + "[P]"
109
+                data2 = item[0][0:-1]
110
+                img = "https://www.shortcut.lv" + item[2]
111
+                desc = title
112
+                content.append((title,self.name+"::"+data2,img,desc))
113
+            return content
113 114
 
114 115
         ### Tiešraides kanānālu saraksts ###
115 116
         elif data=="tiesraide":

+ 11
- 8
sources/mtgplay.py Vedi File

@@ -67,12 +67,12 @@ class Source(SourceBase):
67 67
 
68 68
         if clist=="home":
69 69
             content.extend([
70
-                #("Search", "mtgplay::meklet?country=%s&term={0}"%self.country,"","Search videos"), ### TODO
70
+                ("Search", "mtgplay::search?country=%s&term={0}"%self.country,"","Search videos"), ### TODO
71 71
                 ("TV Live", "mtgplay::videos?country=%s&order=title&type=live"%self.country,"","TV live streams(not always available)"),
72 72
                 ("Last videos", "mtgplay::videos?country=%s&order=-airdate"%self.country,"","Last aired videos"),
73 73
                 ("Categories", "mtgplay::categories?country=%s&order=name"%self.country,"","Categories"),
74 74
                 ("Channels", "mtgplay::channels?country=%s&order=id"%self.country,"","TV channels"),
75
-                ("Programs by name", "mtgplay::formats?country=%s&order=-title"%self.country,"","Programs by name"),
75
+                ("Programs by name", "mtgplay::formats?country=%s&order=title"%self.country,"","Programs by name"),
76 76
                 ("Programs by popularity", "mtgplay::formats?country=%s&order=-popularity"%self.country,"","Programs by popularity")
77 77
             ])
78 78
             return content
@@ -88,6 +88,8 @@ class Source(SourceBase):
88 88
                 content.append(("Previous page", self.name+"::"+data2.encode("utf8"),"", "Goto previous page"))
89 89
 
90 90
             if "_embedded" in r:
91
+                if clist == "search":
92
+                    clist = "formats"
91 93
                 for item in r["_embedded"][clist]:
92 94
                     if "title" in item:
93 95
                         title = item["title"]
@@ -144,11 +146,12 @@ class Source(SourceBase):
144 146
                         #if "country" in qs: data2 += "&country="+qs["country"]
145 147
                         #if "category" in qs: data2 += "&category="+qs["category"]
146 148
                         #if "channel" in qs: data2 += "&channel="+qs["channel"]
147
-                        data2 += "&order=title"
148
-                        air_at = item["latest_video"]["publish_at"] if "publish_at" in item["latest_video"] else ""
149
-                        air_at = air_at[0:16].replace("T"," ") if air_at else ""
150
-                        if air_at:
151
-                            desc = "Last video: %s\n"%air_at + desc
149
+                        data2 += "&order=-id"
150
+                        if "lastest_video" in item:
151
+                            air_at = item["latest_video"]["publish_at"] if "publish_at" in item["latest_video"] else ""
152
+                            air_at = air_at[0:16].replace("T"," ") if air_at else ""
153
+                            if air_at:
154
+                                desc = "Last video: %s\n"%air_at + desc
152 155
 
153 156
                     ### Seasons ###
154 157
                     elif clist == "seasons":
@@ -157,7 +160,7 @@ class Source(SourceBase):
157 160
                         #if "country" in qs: data2 += "&country="+qs["country"]
158 161
                         #if "category" in qs: data2 += "&category="+qs["category"]
159 162
                         #if "channel" in qs: data2 += "&channel="+qs["channel"]
160
-                        data2 += "&order=title"
163
+                        data2 += "&order=-id"
161 164
 
162 165
                         summary = item["summary"] if "summary" in item and item["summary"] else ""
163 166
                         try: