Updated shebang to handle local python changes
| | |
| | | #!/usr/bin/python |
| | | #!/usr/bin/env python |
| | | import argparse |
| | | import os |
| | | import glob |
| | |
| | | import shlex |
| | | import json |
| | | import requests |
| | | import unicodedata |
| | | from querysubsonic import findalbumbyname |
| | | from time import sleep |
| | | |
| | |
| | | bit_rate = metadata['format']['bit_rate'] |
| | | return bit_rate[:2] |
| | | |
| | | def getmetacopyright(): |
| | | copyright = unicodedata.normalize('NFKD', metadata['format']['tag']['copyright']).encode('ascii','ignore') |
| | | return copyright |
| | | |
| | | |
| | | def getmetadatatags(key): |
| | | # get specific data |
| | | tag = metadata['format']['tags'][key] |
| | | tag = cleantag(metadata['format']['tags'][key]) |
| | | return tag |
| | | |
| | | |
| | |
| | | getmetadatatags('title'), getmetadatatags('artist'), |
| | | getmetadatatags('album_artist'), getmetadatatags('album'), |
| | | getmetadatatags('date'), getmetadatatags('genre'), |
| | | getmetadatatags('copyright'),outpath) |
| | | getmetacopyright(),outpath) |
| | | if args.verbose: |
| | | print(command) |
| | | process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE) |