Procházet zdrojové kódy

프린트 제거, 빼 먹은 문법

Surplus_Up (2DU) před 6 roky
rodič
revize
ab80014dcb
3 změnil soubory, kde provedl 8 přidání a 7 odebrání
  1. 1 0
      route/tool/func.py
  2. 7 5
      route/tool/set_mark/namu.py
  3. 0 2
      route/view_xref.py

+ 1 - 0
route/tool/func.py

@@ -35,6 +35,7 @@ for i in range(0, 2):
         from .mark import *
     except ImportError as e:
         if i == 0:
+            print('----')
             print(e)
             print('----')
             if platform.system() == 'Linux':

+ 7 - 5
route/tool/set_mark/namu.py

@@ -533,14 +533,10 @@ def namu(conn, data, title, main_num, include_num):
     redirect = redirect_re.search(data)
     if redirect:
         redirect = redirect.groups()[0]
-        print(redirect)
         
         return_link = tool.link_fix(redirect)
         main_link = return_link[0]
         other_link = return_link[1]
-
-        print(main_link)
-        print(other_link)
         
         backlink += [[title, main_link + other_link, 'redirect']]
         
@@ -689,7 +685,13 @@ def namu(conn, data, title, main_num, include_num):
             else:
                 video_code = ''
 
+            video_start = ''
+
             if youtube_re.search(video[0]):
+                start = re.search(', ?(start=(?:(?!,).)+)', video[1])
+                if start:
+                    video_start = '?' + start.groups()[0]
+
                 video_code = re.sub('^https:\/\/www\.youtube\.com\/watch\?v=', '', video_code)
                 video_code = re.sub('^https:\/\/youtu\.be\/', '', video_code)
                 
@@ -702,7 +704,7 @@ def namu(conn, data, title, main_num, include_num):
             else:
                 video_src = 'https://embed.nicovideo.jp/watch/' + video_code
                 
-            data = video_re.sub('<iframe width="' + video_width + '" height="' + video_height + '" src="' + video_src + '" allowfullscreen frameborder="0"></iframe>', data, 1)
+            data = video_re.sub('<iframe width="' + video_width + '" height="' + video_height + '" src="' + video_src + video_start + '" allowfullscreen frameborder="0"></iframe>', data, 1)
         else:
             break
 

+ 0 - 2
route/view_xref.py

@@ -16,8 +16,6 @@ def view_xref_2(conn, name):
 
     if re.search('#', name):
         name = re.sub('#', '\\\\#', name)
-
-    print(name + '#s-%')
     
     curs.execute("" + \
         "select link, type from back " + \