#1
|
|||
|
|||
Download from csv Videos with titles
Hello everyone,
I have a csv with 2 columns: Title and Link (video) I want Jdownloader do download renaming automatically the archive with the text of the first column (Title) of csv. How to do this? Otherwise jdownloader do download with name chinklist, i dont want this. Thanks in advanced. Edit in 20 jan - I found this code below I found in the forum this script, which looks like it would do what I need, but I can not get it to work, I do not really know where to insert it, I did not find any tutorial to insert script into jdownloader. Can someone help me? Code:
#!/usr/bin/env python import csv import sys import urllib2 import json csvin = csv.DictReader (sys.stdin) csvout = csv.DictWriter (sys.stdout, csvin.fieldnames + ["jderr"]) emptyout = True for l in csvin: links = l ["urls"] pkg = l ["title"] links = links.replace (" ", "%20") pkg = pkg.replace ('"', "'").replace ("&", " ").replace (" ", "%20") url = "**External links are only visible to Supporters**.format (links, pkg, '""', '""') result = urllib2.urlopen (url) resp = None if result.getcode () == 200: resp = json.load (result) if not resp or resp.get ("data") != True: l ["jderr"] = json.dumps (resp) if emptyout: emptyout = False; csvout.writeheader () csvout.writerow (l) Last edited by Program; 20.01.2018 at 16:15. Reason: add more info (script) |
#2
|
||||
|
||||
Instead of CSV, please use different approach with
url#name=XY and packagizer rule that parses filename from anchor. For example see here, https://board.jdownloader.org/showpo...6&postcount=12
__________________
JD-Dev & Server-Admin |
|
|