Explorar o código

single run for v-c2s

Jason hai 1 ano
pai
achega
d8b3ed15da
Modificáronse 1 ficheiros con 39 adicións e 0 borrados
  1. 39 0
      website_clickjobs/type-V/c2S.py

+ 39 - 0
website_clickjobs/type-V/c2S.py

@@ -0,0 +1,39 @@
+#coding=utf-8
+from _execute import *
+
+def addvids(target):
+    pwhitelist = ['https://csr.sinyi.com.tw/governance/index.php','https://www.facebook.com/SinyiRealtyInc.HR','https://csr.sinyi.com.tw/interactive/video.php','https://www.youtube.com/playlist?list=PLftfxwJcQDUCL8v2oB_jHWHue4I6vHyBz','https://hr.sinyi.com.tw/events/tvc/','https://hr.sinyi.com.tw/video','https://www.youtube.com/watch?v=rGQqegE8rbc','https://www.youtube.com/watch?v=JjfqP6akA3c','https://www.facebook.com/sinyifans/','https://www.youtube.com/channel/UCU76s7FGtDvDta2mf2Zdn4Q','https://www.sinyi.com.tw/aboutsinyi/aboutsinyi_publish','https://csr.sinyi.com.tw/','https://events.sinyi.com.tw/20190828_webintro/','https://www.youtube.com/user/sinyicity','https://events.sinyi.com.tw/tvc2018-forhome/','https://hr.sinyi.com.tw/events/1/','https://hr.sinyi.com.tw/events/recommend/','https://events.sinyi.com.tw/sinyi40/','https://csr.sinyi.com.tw/interactive/video-employee.php','https://csr.sinyi.com.tw/interactive/video-environment.php','https://csr.sinyi.com.tw/interactive/video-society.php','https://csr.sinyi.com.tw/society/culture.php','https://csr.sinyi.com.tw/employee/index.php','https://www.youtube.com/watch?v=FqiKpqgB-bU','https://www.youtube.com/watch?v=UkxtlJAaqP8','https://www.youtube.com/watch?v=A5GuB3Enw9U','https://www.youtube.com/watch?v=fx4fTBh9PFo','https://events.sinyi.com.tw/tvc/']
+
+    for v in pwhitelist:
+        if v not in target:
+            target.append(v)
+    
+    return target
+
+clickvideo = 2 # set to 1 to alert if video is found (DOES NOT CLICK!), requires whitelist
+# ^ set to 2 to click the video when found, requires whitelist
+# ^ any other value will only search for videos based on termlist
+savefile = 0 # set to 1 to save screenshot and ranking to file
+sec = 1
+client = "信義房屋"
+target=[]
+
+if clickvideo == 1 or clickvideo == 2:
+    runcount=0
+    kws=None
+    try:
+        runcount+=1
+        start_time = time.time()
+        kw = pickterm(client)
+        target = addvids(target)
+        print(len(target))
+        process_one(kw, target, clickvideo, savefile, sec)
+        duration = time.time()-start_time
+        print("Runs: " + str(runcount) + " | Duration: " + str(duration))
+    except:
+        print('Runtime Error')
+        traceback.print_exc()
+    time.sleep(7)
+
+elif savefile == 1:
+    execute(termlist, "", clickvideo, savefile, sec)