def main(): parser = OptionParser() parser.add_option("-j", "--json", action="store", default=xdef.json) parser.add_option("-s", "--src", action="store", default="") parser.add_option("-r", "--ref", action="store", default="") parser.add_option("-u", "--url", action="store", default="") (options, args) = parser.parse_args(sys.argv[1:]) src = options.src ref = options.ref url = options.url if src == "": with open(options.json, "r") as fd: data = json.load(fd) src = data["src"] ref = data["ref"] if src != "": xplay.playURL(src, ref) return if url != "": vod.playURL(url, ref) return
def main(): if len(sys.argv) < 2: return m = re.search(r'view.py\?v=(.*)', sys.argv[1]) if m: url = m.group(1) else: url = sys.argv[1] xarg.player = 'dbg' vod.playURL(url, None) return
def testvod(url): print('[testvod]\n\n\t'+url) xdef.player = 'dbg' vod.playURL(url, None)