├── .gitattributes ├── .gitignore ├── .travis.yml ├── AUTHORS.rst ├── CONTRIBUTING.rst ├── HISTORY.rst ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.rst ├── docs ├── .gitignore ├── Makefile ├── _static │ └── logo.png ├── authors.rst ├── conf.py ├── contributing.rst ├── history.rst ├── index.rst ├── installation.rst ├── make.bat ├── readme.rst └── usage.rst ├── playlistfromsong ├── __init__.py ├── assets │ ├── css │ │ ├── style.css │ │ └── style2.css │ └── js │ │ ├── html5media.min.js │ │ ├── index.js │ │ ├── jquery.min.js │ │ └── prefixfree.min.js ├── cli.py ├── playlistfromsong.py ├── server.py └── templates │ └── index.html ├── requirements_dev.txt ├── setup.cfg ├── setup.py ├── tests ├── __init__.py └── test_playlistfromsong.py └── tox.ini /.gitattributes: -------------------------------------------------------------------------------- 1 | # Basic .gitattributes for a python repo. 2 | 3 | docs/* linguist-vendored 4 | playlistfromsong/assets/* linguist-vendored 5 | playlistfromsong/templates/* linguist-vendored 6 | 7 | # Source files 8 | # ============ 9 | *.pxd text 10 | *.py text 11 | *.py3 text 12 | *.pyw text 13 | *.pyx text 14 | 15 | # Binary files 16 | # ============ 17 | *.db binary 18 | *.p binary 19 | *.pkl binary 20 | *.pyc binary 21 | *.pyd binary 22 | *.pyo binary 23 | 24 | # Note: .db, .p, and .pkl files are associated 25 | # with the python modules ``pickle``, ``dbm.*``, 26 | # ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` 27 | # (among others). 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | 55 | # Sphinx documentation 56 | docs/_build/ 57 | 58 | # PyBuilder 59 | target/ 60 | 61 | # pyenv python configuration file 62 | .python-version 63 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | python: 4 | - "3.5" 5 | before_script: 6 | - sudo apt-get install -y libav-tools 7 | - sudo apt-get install -y libavcodec-extra-* 8 | - wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz 9 | - tar xvfJ ffmpeg-git-64bit-static.tar.xz 10 | - sudo mv ffmpeg-git-*/ffmpeg /usr/bin/ffmpeg 11 | - sudo pip install playlistfromsong 12 | install: 13 | # python 14 | - pip install -e . 15 | script: 16 | - make test 17 | after_success: 18 | - bash <(curl -s https://codecov.io/bash) -------------------------------------------------------------------------------- /AUTHORS.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | Credits 3 | ======= 4 | 5 | Development Lead 6 | ---------------- 7 | 8 | * Zack 9 | 10 | Contributors 11 | ------------ 12 | 13 | None yet. Why not be the first? 14 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | .. highlight:: shell 2 | 3 | ============ 4 | Contributing 5 | ============ 6 | 7 | Contributions are welcome, and they are greatly appreciated! Every 8 | little bit helps, and credit will always be given. 9 | 10 | You can contribute in many ways: 11 | 12 | Types of Contributions 13 | ---------------------- 14 | 15 | Report Bugs 16 | ~~~~~~~~~~~ 17 | 18 | Report bugs at https://github.com/schollz/playlistfromsong/issues. 19 | 20 | If you are reporting a bug, please include: 21 | 22 | * Your operating system name and version. 23 | * Any details about your local setup that might be helpful in troubleshooting. 24 | * Detailed steps to reproduce the bug. 25 | 26 | Fix Bugs 27 | ~~~~~~~~ 28 | 29 | Look through the GitHub issues for bugs. Anything tagged with "bug" 30 | and "help wanted" is open to whoever wants to implement it. 31 | 32 | Implement Features 33 | ~~~~~~~~~~~~~~~~~~ 34 | 35 | Look through the GitHub issues for features. Anything tagged with "enhancement" 36 | and "help wanted" is open to whoever wants to implement it. 37 | 38 | Write Documentation 39 | ~~~~~~~~~~~~~~~~~~~ 40 | 41 | playlistfromsong could always use more documentation, whether as part of the 42 | official playlistfromsong docs, in docstrings, or even on the web in blog posts, 43 | articles, and such. 44 | 45 | Submit Feedback 46 | ~~~~~~~~~~~~~~~ 47 | 48 | The best way to send feedback is to file an issue at https://github.com/schollz/playlistfromsong/issues. 49 | 50 | If you are proposing a feature: 51 | 52 | * Explain in detail how it would work. 53 | * Keep the scope as narrow as possible, to make it easier to implement. 54 | * Remember that this is a volunteer-driven project, and that contributions 55 | are welcome :) 56 | 57 | Get Started! 58 | ------------ 59 | 60 | Ready to contribute? Here's how to set up `playlistfromsong` for local development. 61 | 62 | 1. Fork the `playlistfromsong` repo on GitHub. 63 | 2. Clone your fork locally:: 64 | 65 | $ git clone git@github.com:your_name_here/playlistfromsong.git 66 | 67 | 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: 68 | 69 | $ mkvirtualenv playlistfromsong 70 | $ cd playlistfromsong/ 71 | $ python setup.py develop 72 | 73 | 4. Create a branch for local development:: 74 | 75 | $ git checkout -b name-of-your-bugfix-or-feature 76 | 77 | Now you can make your changes locally. 78 | 79 | 5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:: 80 | 81 | $ flake8 playlistfromsong tests 82 | $ python setup.py test or py.test 83 | $ tox 84 | 85 | To get flake8 and tox, just pip install them into your virtualenv. 86 | 87 | 6. Commit your changes and push your branch to GitHub:: 88 | 89 | $ git add . 90 | $ git commit -m "Your detailed description of your changes." 91 | $ git push origin name-of-your-bugfix-or-feature 92 | 93 | 7. Submit a pull request through the GitHub website. 94 | 95 | Pull Request Guidelines 96 | ----------------------- 97 | 98 | Before you submit a pull request, check that it meets these guidelines: 99 | 100 | 1. The pull request should include tests. 101 | 2. If the pull request adds functionality, the docs should be updated. Put 102 | your new functionality into a function with a docstring, and add the 103 | feature to the list in README.rst. 104 | 3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check 105 | https://travis-ci.org/schollz/playlistfromsong/pull_requests 106 | and make sure that the tests pass for all supported Python versions. 107 | 108 | Tips 109 | ---- 110 | 111 | To run a subset of tests:: 112 | 113 | $ py.test tests.test_playlistfromsong 114 | 115 | -------------------------------------------------------------------------------- /HISTORY.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | History 3 | ======= 4 | 5 | 2.0.0 (2017-07-04) 6 | ------------------ 7 | 8 | * New ``--server`` option for starting a music server 9 | 10 | 1.0.0 (2017-06-25) 11 | ------------------ 12 | 13 | * Move to cookiecutter for improved packaging and tests 14 | 15 | 0.21.0 (2017-03-29) 16 | ------------------ 17 | 18 | * First stable release -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | MIT License 3 | 4 | Copyright (c) 2017, Zack 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | 12 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include AUTHORS.rst 2 | include CONTRIBUTING.rst 3 | include HISTORY.rst 4 | include LICENSE 5 | include README.rst 6 | 7 | recursive-include tests * 8 | recursive-include playlistfromsong/assets * 9 | recursive-include playlistfromsong/templates * 10 | recursive-exclude * __pycache__ 11 | recursive-exclude * *.py[co] 12 | 13 | recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif 14 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean clean-test clean-pyc clean-build docs help clean-mp3 2 | .DEFAULT_GOAL := help 3 | define BROWSER_PYSCRIPT 4 | import os, webbrowser, sys 5 | try: 6 | from urllib import pathname2url 7 | except: 8 | from urllib.request import pathname2url 9 | 10 | webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) 11 | endef 12 | export BROWSER_PYSCRIPT 13 | 14 | define PRINT_HELP_PYSCRIPT 15 | import re, sys 16 | 17 | for line in sys.stdin: 18 | match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) 19 | if match: 20 | target, help = match.groups() 21 | print("%-20s %s" % (target, help)) 22 | endef 23 | export PRINT_HELP_PYSCRIPT 24 | BROWSER := python -c "$$BROWSER_PYSCRIPT" 25 | 26 | help: 27 | @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) 28 | 29 | clean: clean-mp3 clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts 30 | 31 | clean-mp3: 32 | find . -name '*.mp3' -exec rm -f {} + 33 | 34 | clean-build: ## remove build artifacts 35 | rm -fr build/ 36 | rm -fr dist/ 37 | rm -fr .eggs/ 38 | find . -name '*.egg-info' -exec rm -fr {} + 39 | find . -name '*.egg' -exec rm -f {} + 40 | 41 | clean-pyc: ## remove Python file artifacts 42 | find . -name '*.pyc' -exec rm -f {} + 43 | find . -name '*.pyo' -exec rm -f {} + 44 | find . -name '*~' -exec rm -f {} + 45 | find . -name '__pycache__' -exec rm -fr {} + 46 | 47 | clean-test: ## remove test and coverage artifacts 48 | rm -fr .tox/ 49 | rm -f .coverage 50 | rm -fr htmlcov/ 51 | 52 | lint: ## check style with flake8 53 | flake8 playlistfromsong tests 54 | 55 | test: ## run tests quickly with the default Python 56 | py.test 57 | 58 | 59 | test-all: ## run tests on every Python version with tox 60 | tox 61 | 62 | coverage: ## check code coverage quickly with the default Python 63 | coverage run --source playlistfromsong -m pytest 64 | coverage report -m 65 | coverage html 66 | $(BROWSER) htmlcov/index.html 67 | 68 | docs: ## generate Sphinx HTML documentation, including API docs 69 | rm -f docs/playlistfromsong.rst 70 | rm -f docs/modules.rst 71 | sphinx-apidoc -o docs/ playlistfromsong 72 | $(MAKE) -C docs clean 73 | $(MAKE) -C docs html 74 | $(BROWSER) docs/_build/html/index.html 75 | 76 | servedocs: docs ## compile the docs watching for changes 77 | watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . 78 | 79 | release: dist ## package and upload a release 80 | twine upload dist/* 81 | #python3 setup.py sdist upload 82 | #python3 setup.py bdist_wheel upload 83 | 84 | dist: clean ## builds source and wheel package 85 | python3 setup.py sdist 86 | python3 setup.py bdist_wheel 87 | ls -l dist 88 | 89 | install: clean ## install the package to the active Python's site-packages 90 | python3 setup.py install 91 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ================ 2 | playlistfromsong 3 | ================ 4 | 5 | 6 | .. image:: https://img.shields.io/pypi/v/playlistfromsong.svg 7 | :target: https://pypi.python.org/pypi/playlistfromsong 8 | 9 | .. image:: https://img.shields.io/travis/schollz/playlistfromsong.svg 10 | :target: https://travis-ci.org/schollz/playlistfromsong 11 | 12 | .. image:: https://readthedocs.org/projects/playlistfromsong/badge/?version=latest 13 | :target: https://playlistfromsong.readthedocs.io/en/latest/?badge=latest 14 | :alt: Documentation Status 15 | 16 | .. image:: https://pyup.io/repos/github/schollz/playlistfromsong/shield.svg 17 | :target: https://pyup.io/repos/github/schollz/playlistfromsong/ 18 | :alt: Updates 19 | 20 | 21 | Generate an offline playlist from a single song. 22 | 23 | Features 24 | --------- 25 | 26 | - Similar song matching using last.fm or Spotify 27 | - Automatic downloading of songs 28 | - Builtin music server for webhooks 29 | 30 | Quickstart 31 | ------------ 32 | 33 | First install `ffmpeg`_: 34 | 35 | :: 36 | 37 | sudo apt-get install ffmpeg (DEBIAN) 38 | brew install ffmpeg (MAC) 39 | 40 | .. _ffmpeg: https://ffmpeg.org/download.html 41 | 42 | Install with ``pip``:: 43 | 44 | pip install playlistfromsong 45 | 46 | 47 | Download a playlist of 5 songs similar to Miles Davis' *Blue In Green*:: 48 | 49 | playlistfromsong --song 'Miles Davis Blue In Green' --num 5 -f /path/to/save 50 | 51 | .. image:: http://i.imgur.com/ldVHZcc.gif 52 | :target: http://i.imgur.com/ldVHZcc.gif 53 | :alt: Demo1 54 | 55 | Use a bearer token ``--bearer`` to use Spotify to find suggestions:: 56 | 57 | playlistfromsong --song 'Miles Davis Blue In Green' --num 5 -f /path/to/save -b 'BEARER' 58 | 59 | .. image:: http://i.imgur.com/uzEEEFh.gif 60 | :target: http://i.imgur.com/uzEEEFh.gif 61 | :alt: Demo1 62 | 63 | 64 | For more complete usage, see the docs. 65 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | /playlistfromsong.rst 2 | /playlistfromsong.*.rst 3 | /modules.rst 4 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " devhelp to make HTML files and a Devhelp project" 34 | @echo " epub to make an epub" 35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 | @echo " text to make text files" 39 | @echo " man to make manual pages" 40 | @echo " texinfo to make Texinfo files" 41 | @echo " info to make Texinfo files and run them through makeinfo" 42 | @echo " gettext to make PO message catalogs" 43 | @echo " changes to make an overview of all changed/added/deprecated items" 44 | @echo " xml to make Docutils-native XML files" 45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 | @echo " linkcheck to check all external links for integrity" 47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 | 49 | clean: 50 | rm -rf $(BUILDDIR)/* 51 | 52 | html: 53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 54 | @echo 55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 56 | 57 | dirhtml: 58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 59 | @echo 60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 61 | 62 | singlehtml: 63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 64 | @echo 65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 66 | 67 | pickle: 68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 69 | @echo 70 | @echo "Build finished; now you can process the pickle files." 71 | 72 | json: 73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 74 | @echo 75 | @echo "Build finished; now you can process the JSON files." 76 | 77 | htmlhelp: 78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 79 | @echo 80 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 81 | ".hhp project file in $(BUILDDIR)/htmlhelp." 82 | 83 | qthelp: 84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 85 | @echo 86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/playlistfromsong.qhcp" 89 | @echo "To view the help file:" 90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/playlistfromsong.qhc" 91 | 92 | devhelp: 93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 94 | @echo 95 | @echo "Build finished." 96 | @echo "To view the help file:" 97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/playlistfromsong" 98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/playlistfromsong" 99 | @echo "# devhelp" 100 | 101 | epub: 102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 103 | @echo 104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 105 | 106 | latex: 107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 108 | @echo 109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 111 | "(use \`make latexpdf' here to do that automatically)." 112 | 113 | latexpdf: 114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 115 | @echo "Running LaTeX files through pdflatex..." 116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 118 | 119 | latexpdfja: 120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 121 | @echo "Running LaTeX files through platex and dvipdfmx..." 122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 124 | 125 | text: 126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 127 | @echo 128 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 129 | 130 | man: 131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 132 | @echo 133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 134 | 135 | texinfo: 136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 137 | @echo 138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 139 | @echo "Run \`make' in that directory to run these through makeinfo" \ 140 | "(use \`make info' here to do that automatically)." 141 | 142 | info: 143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 144 | @echo "Running Texinfo files through makeinfo..." 145 | make -C $(BUILDDIR)/texinfo info 146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 147 | 148 | gettext: 149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 150 | @echo 151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 152 | 153 | changes: 154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 155 | @echo 156 | @echo "The overview file is in $(BUILDDIR)/changes." 157 | 158 | linkcheck: 159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 160 | @echo 161 | @echo "Link check complete; look for any errors in the above output " \ 162 | "or in $(BUILDDIR)/linkcheck/output.txt." 163 | 164 | doctest: 165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 166 | @echo "Testing of doctests in the sources finished, look at the " \ 167 | "results in $(BUILDDIR)/doctest/output.txt." 168 | 169 | xml: 170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 171 | @echo 172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 173 | 174 | pseudoxml: 175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 176 | @echo 177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 178 | -------------------------------------------------------------------------------- /docs/_static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/schollz/playlistfromsong/ff8163a4997efb3682bfae3d3dbc7ba5c0a58273/docs/_static/logo.png -------------------------------------------------------------------------------- /docs/authors.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../AUTHORS.rst 2 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # playlistfromsong documentation build configuration file, created by 5 | # sphinx-quickstart on Tue Jul 9 22:26:36 2013. 6 | # 7 | # This file is execfile()d with the current directory set to its 8 | # containing dir. 9 | # 10 | # Note that not all possible configuration values are present in this 11 | # autogenerated file. 12 | # 13 | # All configuration values have a default; values that are commented out 14 | # serve to show the default. 15 | 16 | import sys 17 | import os 18 | 19 | # If extensions (or modules to document with autodoc) are in another 20 | # directory, add these directories to sys.path here. If the directory is 21 | # relative to the documentation root, use os.path.abspath to make it 22 | # absolute, like shown here. 23 | #sys.path.insert(0, os.path.abspath('.')) 24 | 25 | # Get the project root dir, which is the parent dir of this 26 | cwd = os.getcwd() 27 | project_root = os.path.dirname(cwd) 28 | 29 | # Insert the project root dir as the first element in the PYTHONPATH. 30 | # This lets us ensure that the source package is imported, and that its 31 | # version is used. 32 | sys.path.insert(0, project_root) 33 | 34 | import playlistfromsong 35 | 36 | # -- General configuration --------------------------------------------- 37 | 38 | # If your documentation needs a minimal Sphinx version, state it here. 39 | #needs_sphinx = '1.0' 40 | 41 | # Add any Sphinx extension module names here, as strings. They can be 42 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 43 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] 44 | 45 | # Add any paths that contain templates here, relative to this directory. 46 | templates_path = ['_templates'] 47 | 48 | # The suffix of source filenames. 49 | source_suffix = '.rst' 50 | 51 | # The encoding of source files. 52 | #source_encoding = 'utf-8-sig' 53 | 54 | # The master toctree document. 55 | master_doc = 'index' 56 | 57 | # General information about the project. 58 | project = u'playlistfromsong' 59 | copyright = u"2017, Zack" 60 | 61 | # The version info for the project you're documenting, acts as replacement 62 | # for |version| and |release|, also used in various other places throughout 63 | # the built documents. 64 | # 65 | # The short X.Y version. 66 | version = playlistfromsong.__version__ 67 | # The full version, including alpha/beta/rc tags. 68 | release = playlistfromsong.__version__ 69 | 70 | # The language for content autogenerated by Sphinx. Refer to documentation 71 | # for a list of supported languages. 72 | #language = None 73 | 74 | # There are two options for replacing |today|: either, you set today to 75 | # some non-false value, then it is used: 76 | #today = '' 77 | # Else, today_fmt is used as the format for a strftime call. 78 | #today_fmt = '%B %d, %Y' 79 | 80 | # List of patterns, relative to source directory, that match files and 81 | # directories to ignore when looking for source files. 82 | exclude_patterns = ['_build'] 83 | 84 | # The reST default role (used for this markup: `text`) to use for all 85 | # documents. 86 | #default_role = None 87 | 88 | # If true, '()' will be appended to :func: etc. cross-reference text. 89 | #add_function_parentheses = True 90 | 91 | # If true, the current module name will be prepended to all description 92 | # unit titles (such as .. function::). 93 | #add_module_names = True 94 | 95 | # If true, sectionauthor and moduleauthor directives will be shown in the 96 | # output. They are ignored by default. 97 | #show_authors = False 98 | 99 | # The name of the Pygments (syntax highlighting) style to use. 100 | pygments_style = 'sphinx' 101 | 102 | # A list of ignored prefixes for module index sorting. 103 | #modindex_common_prefix = [] 104 | 105 | # If true, keep warnings as "system message" paragraphs in the built 106 | # documents. 107 | #keep_warnings = False 108 | 109 | 110 | # -- Options for HTML output ------------------------------------------- 111 | 112 | # The theme to use for HTML and HTML Help pages. See the documentation for 113 | # a list of builtin themes. 114 | html_theme = 'alabaster' 115 | html_theme_options = { 116 | 'logo': 'logo.png', 117 | 'github_user': 'schollz', 118 | 'github_repo': 'playlistfromsong', 119 | 'github_button': True, 120 | 'github_count': True, 121 | 'travis_button': True, 122 | } 123 | 124 | # Theme options are theme-specific and customize the look and feel of a 125 | # theme further. For a list of options available for each theme, see the 126 | # documentation. 127 | #html_theme_options = {} 128 | 129 | # Add any paths that contain custom themes here, relative to this directory. 130 | #html_theme_path = [] 131 | 132 | # The name for this set of Sphinx documents. If None, it defaults to 133 | # " v documentation". 134 | #html_title = None 135 | 136 | # A shorter title for the navigation bar. Default is the same as 137 | # html_title. 138 | #html_short_title = None 139 | 140 | # The name of an image file (relative to this directory) to place at the 141 | # top of the sidebar. 142 | html_logo = '_static/logo.png' 143 | 144 | # The name of an image file (within the static path) to use as favicon 145 | # of the docs. This file should be a Windows icon file (.ico) being 146 | # 16x16 or 32x32 pixels large. 147 | #html_favicon = None 148 | 149 | # Add any paths that contain custom static files (such as style sheets) 150 | # here, relative to this directory. They are copied after the builtin 151 | # static files, so a file named "default.css" will overwrite the builtin 152 | # "default.css". 153 | html_static_path = ['_static'] 154 | 155 | # If not '', a 'Last updated on:' timestamp is inserted at every page 156 | # bottom, using the given strftime format. 157 | #html_last_updated_fmt = '%b %d, %Y' 158 | 159 | # If true, SmartyPants will be used to convert quotes and dashes to 160 | # typographically correct entities. 161 | #html_use_smartypants = True 162 | 163 | # Custom sidebar templates, maps document names to template names. 164 | #html_sidebars = {} 165 | 166 | # Additional templates that should be rendered to pages, maps page names 167 | # to template names. 168 | #html_additional_pages = {} 169 | 170 | # If false, no module index is generated. 171 | #html_domain_indices = True 172 | 173 | # If false, no index is generated. 174 | #html_use_index = True 175 | 176 | # If true, the index is split into individual pages for each letter. 177 | #html_split_index = False 178 | 179 | # If true, links to the reST sources are added to the pages. 180 | #html_show_sourcelink = True 181 | 182 | # If true, "Created using Sphinx" is shown in the HTML footer. 183 | # Default is True. 184 | #html_show_sphinx = True 185 | 186 | # If true, "(C) Copyright ..." is shown in the HTML footer. 187 | # Default is True. 188 | #html_show_copyright = True 189 | 190 | # If true, an OpenSearch description file will be output, and all pages 191 | # will contain a tag referring to it. The value of this option 192 | # must be the base URL from which the finished HTML is served. 193 | #html_use_opensearch = '' 194 | 195 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 196 | #html_file_suffix = None 197 | 198 | # Output file base name for HTML help builder. 199 | htmlhelp_basename = 'playlistfromsongdoc' 200 | 201 | 202 | # -- Options for LaTeX output ------------------------------------------ 203 | 204 | latex_elements = { 205 | # The paper size ('letterpaper' or 'a4paper'). 206 | #'papersize': 'letterpaper', 207 | 208 | # The font size ('10pt', '11pt' or '12pt'). 209 | #'pointsize': '10pt', 210 | 211 | # Additional stuff for the LaTeX preamble. 212 | #'preamble': '', 213 | } 214 | 215 | # Grouping the document tree into LaTeX files. List of tuples 216 | # (source start file, target name, title, author, documentclass 217 | # [howto/manual]). 218 | latex_documents = [ 219 | ('index', 'playlistfromsong.tex', 220 | u'playlistfromsong Documentation', 221 | u'Zack', 'manual'), 222 | ] 223 | 224 | # The name of an image file (relative to this directory) to place at 225 | # the top of the title page. 226 | #latex_logo = None 227 | 228 | # For "manual" documents, if this is true, then toplevel headings 229 | # are parts, not chapters. 230 | #latex_use_parts = False 231 | 232 | # If true, show page references after internal links. 233 | #latex_show_pagerefs = False 234 | 235 | # If true, show URL addresses after external links. 236 | #latex_show_urls = False 237 | 238 | # Documents to append as an appendix to all manuals. 239 | #latex_appendices = [] 240 | 241 | # If false, no module index is generated. 242 | #latex_domain_indices = True 243 | 244 | 245 | # -- Options for manual page output ------------------------------------ 246 | 247 | # One entry per manual page. List of tuples 248 | # (source start file, name, description, authors, manual section). 249 | man_pages = [ 250 | ('index', 'playlistfromsong', 251 | u'playlistfromsong Documentation', 252 | [u'Zack'], 1) 253 | ] 254 | 255 | # If true, show URL addresses after external links. 256 | #man_show_urls = False 257 | 258 | 259 | # -- Options for Texinfo output ---------------------------------------- 260 | 261 | # Grouping the document tree into Texinfo files. List of tuples 262 | # (source start file, target name, title, author, 263 | # dir menu entry, description, category) 264 | texinfo_documents = [ 265 | ('index', 'playlistfromsong', 266 | u'playlistfromsong Documentation', 267 | u'Zack', 268 | 'playlistfromsong', 269 | 'One line description of project.', 270 | 'Miscellaneous'), 271 | ] 272 | 273 | # Documents to append as an appendix to all manuals. 274 | #texinfo_appendices = [] 275 | 276 | # If false, no module index is generated. 277 | #texinfo_domain_indices = True 278 | 279 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 280 | #texinfo_show_urls = 'footnote' 281 | 282 | # If true, do not generate a @detailmenu in the "Top" node's menu. 283 | #texinfo_no_detailmenu = False 284 | -------------------------------------------------------------------------------- /docs/contributing.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../CONTRIBUTING.rst 2 | -------------------------------------------------------------------------------- /docs/history.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../HISTORY.rst 2 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to playlistfromsong's documentation! 2 | ====================================== 3 | 4 | Contents: 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | readme 10 | installation 11 | usage 12 | modules 13 | contributing 14 | authors 15 | history 16 | 17 | Indices and tables 18 | ================== 19 | 20 | * :ref:`genindex` 21 | * :ref:`modindex` 22 | * :ref:`search` 23 | -------------------------------------------------------------------------------- /docs/installation.rst: -------------------------------------------------------------------------------- 1 | .. highlight:: shell 2 | 3 | ============ 4 | Installation 5 | ============ 6 | 7 | 8 | Stable release 9 | -------------- 10 | 11 | To install playlistfromsong, run this command in your terminal: 12 | 13 | .. code-block:: console 14 | 15 | $ pip install playlistfromsong 16 | 17 | This is the preferred method to install playlistfromsong, as it will always install the most recent stable release. 18 | 19 | If you don't have `pip`_ installed, this `Python installation guide`_ can guide 20 | you through the process. 21 | 22 | .. _pip: https://pip.pypa.io 23 | .. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/ 24 | 25 | 26 | From sources 27 | ------------ 28 | 29 | The sources for playlistfromsong can be downloaded from the `Github repo`_. 30 | 31 | You can either clone the public repository: 32 | 33 | .. code-block:: console 34 | 35 | $ git clone git://github.com/schollz/playlistfromsong 36 | 37 | Or download the `tarball`_: 38 | 39 | .. code-block:: console 40 | 41 | $ curl -OL https://github.com/schollz/playlistfromsong/tarball/master 42 | 43 | Once you have a copy of the source, you can install it with: 44 | 45 | .. code-block:: console 46 | 47 | $ python setup.py install 48 | 49 | 50 | .. _Github repo: https://github.com/schollz/playlistfromsong 51 | .. _tarball: https://github.com/schollz/playlistfromsong/tarball/master 52 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. xml to make Docutils-native XML files 37 | echo. pseudoxml to make pseudoxml-XML files for display purposes 38 | echo. linkcheck to check all external links for integrity 39 | echo. doctest to run all doctests embedded in the documentation if enabled 40 | goto end 41 | ) 42 | 43 | if "%1" == "clean" ( 44 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 45 | del /q /s %BUILDDIR%\* 46 | goto end 47 | ) 48 | 49 | 50 | %SPHINXBUILD% 2> nul 51 | if errorlevel 9009 ( 52 | echo. 53 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 54 | echo.installed, then set the SPHINXBUILD environment variable to point 55 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 56 | echo.may add the Sphinx directory to PATH. 57 | echo. 58 | echo.If you don't have Sphinx installed, grab it from 59 | echo.http://sphinx-doc.org/ 60 | exit /b 1 61 | ) 62 | 63 | if "%1" == "html" ( 64 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 65 | if errorlevel 1 exit /b 1 66 | echo. 67 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 68 | goto end 69 | ) 70 | 71 | if "%1" == "dirhtml" ( 72 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 73 | if errorlevel 1 exit /b 1 74 | echo. 75 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 76 | goto end 77 | ) 78 | 79 | if "%1" == "singlehtml" ( 80 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 81 | if errorlevel 1 exit /b 1 82 | echo. 83 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 84 | goto end 85 | ) 86 | 87 | if "%1" == "pickle" ( 88 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 89 | if errorlevel 1 exit /b 1 90 | echo. 91 | echo.Build finished; now you can process the pickle files. 92 | goto end 93 | ) 94 | 95 | if "%1" == "json" ( 96 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 97 | if errorlevel 1 exit /b 1 98 | echo. 99 | echo.Build finished; now you can process the JSON files. 100 | goto end 101 | ) 102 | 103 | if "%1" == "htmlhelp" ( 104 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 105 | if errorlevel 1 exit /b 1 106 | echo. 107 | echo.Build finished; now you can run HTML Help Workshop with the ^ 108 | .hhp project file in %BUILDDIR%/htmlhelp. 109 | goto end 110 | ) 111 | 112 | if "%1" == "qthelp" ( 113 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 114 | if errorlevel 1 exit /b 1 115 | echo. 116 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 117 | .qhcp project file in %BUILDDIR%/qthelp, like this: 118 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\playlistfromsong.qhcp 119 | echo.To view the help file: 120 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\playlistfromsong.ghc 121 | goto end 122 | ) 123 | 124 | if "%1" == "devhelp" ( 125 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished. 129 | goto end 130 | ) 131 | 132 | if "%1" == "epub" ( 133 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 134 | if errorlevel 1 exit /b 1 135 | echo. 136 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 137 | goto end 138 | ) 139 | 140 | if "%1" == "latex" ( 141 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 142 | if errorlevel 1 exit /b 1 143 | echo. 144 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 145 | goto end 146 | ) 147 | 148 | if "%1" == "latexpdf" ( 149 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 150 | cd %BUILDDIR%/latex 151 | make all-pdf 152 | cd %BUILDDIR%/.. 153 | echo. 154 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 155 | goto end 156 | ) 157 | 158 | if "%1" == "latexpdfja" ( 159 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 160 | cd %BUILDDIR%/latex 161 | make all-pdf-ja 162 | cd %BUILDDIR%/.. 163 | echo. 164 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 165 | goto end 166 | ) 167 | 168 | if "%1" == "text" ( 169 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 170 | if errorlevel 1 exit /b 1 171 | echo. 172 | echo.Build finished. The text files are in %BUILDDIR%/text. 173 | goto end 174 | ) 175 | 176 | if "%1" == "man" ( 177 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 178 | if errorlevel 1 exit /b 1 179 | echo. 180 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 181 | goto end 182 | ) 183 | 184 | if "%1" == "texinfo" ( 185 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 186 | if errorlevel 1 exit /b 1 187 | echo. 188 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 189 | goto end 190 | ) 191 | 192 | if "%1" == "gettext" ( 193 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 194 | if errorlevel 1 exit /b 1 195 | echo. 196 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 197 | goto end 198 | ) 199 | 200 | if "%1" == "changes" ( 201 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 202 | if errorlevel 1 exit /b 1 203 | echo. 204 | echo.The overview file is in %BUILDDIR%/changes. 205 | goto end 206 | ) 207 | 208 | if "%1" == "linkcheck" ( 209 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 210 | if errorlevel 1 exit /b 1 211 | echo. 212 | echo.Link check complete; look for any errors in the above output ^ 213 | or in %BUILDDIR%/linkcheck/output.txt. 214 | goto end 215 | ) 216 | 217 | if "%1" == "doctest" ( 218 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 219 | if errorlevel 1 exit /b 1 220 | echo. 221 | echo.Testing of doctests in the sources finished, look at the ^ 222 | results in %BUILDDIR%/doctest/output.txt. 223 | goto end 224 | ) 225 | 226 | if "%1" == "xml" ( 227 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 228 | if errorlevel 1 exit /b 1 229 | echo. 230 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 231 | goto end 232 | ) 233 | 234 | if "%1" == "pseudoxml" ( 235 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 236 | if errorlevel 1 exit /b 1 237 | echo. 238 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 239 | goto end 240 | ) 241 | 242 | :end 243 | -------------------------------------------------------------------------------- /docs/readme.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../README.rst 2 | -------------------------------------------------------------------------------- /docs/usage.rst: -------------------------------------------------------------------------------- 1 | ===== 2 | Usage 3 | ===== 4 | 5 | Generate a playlist from song 6 | ------------------------------ 7 | 8 | Download a playlist from a song by specifying the artist and the song:: 9 | 10 | playlistfromsong -s 'Miles Davis Blue In Green' 11 | 12 | By default, three songs are downloaded (the original song plus 2 that are similar), but you can change this with ``-n``:: 13 | 14 | playlistfromsong -s 'Miles Davis Blue In Green' -n 30 15 | 16 | By default, the similar songs are found using last.fm, but you can choose to use Spotify instead, by providing a bearer token. Obtain a bearer token by going to https://developer.spotify.com/web-api/console/get-track/ and click "Get OAUTH_TOKEN". Then apply your token::: 17 | 18 | playlistfromsong -s 'Miles Davis Blue In Green' -n 30 -b 'TOKEN' 19 | 20 | 21 | Finally, you can specify a specific place to store the files by using the ``-f`` flag:: 22 | 23 | playlistfromsong -s 'Miles Davis Blue In Green' -f /music 24 | 25 | 26 | Simple music server 27 | -------------------- 28 | 29 | There is a built-in simple music server that you can use to play your music, but also includes an API for webhooks for automatically generating playlists from songs. 30 | 31 | Star the server using:: 32 | 33 | playlistfromsong --serve -f /path/to/music 34 | 35 | The default port is 5000, and you should be able to see your server at http://localhost:5000. You can also specify the port with ``--port X``. 36 | 37 | There are routes for directly downloading songs. For instance, to generate a playlist in the current folder, just open:: 38 | 39 | http://localhost:5000/download/10/Miles Davis Blue In Green 40 | 41 | This is very effective for using with IFTTT to automatically download playlists based on songs that are liked on Youtube / Spotify. 42 | 43 | 44 | -------------------------------------------------------------------------------- /playlistfromsong/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """Top-level package for playlistfromsong.""" 4 | 5 | __author__ = """Zack""" 6 | __email__ = 'hypercube.platforms@gmail.com' 7 | __version__ = '2.1.1' 8 | -------------------------------------------------------------------------------- /playlistfromsong/assets/css/style.css: -------------------------------------------------------------------------------- 1 | /* Font Family 2 | ================================================== */ 3 | 4 | @import url("//fonts.googleapis.com/css?family=Yanone+Kaffeesatz:200,300,400"); 5 | 6 | 7 | /* Desktop 8 | ================================================== */ 9 | 10 | .container { position:relative; margin:0 auto; width:700px; } 11 | .column { width:inherit; } 12 | 13 | 14 | /* Tablet (Portrait) 15 | ================================================== */ 16 | 17 | @media only screen and (min-width: 768px) and (max-width: 959px) { 18 | .container { width:556px; } 19 | } 20 | 21 | 22 | /* Mobile (Portrait) 23 | ================================================== */ 24 | 25 | @media only screen and (max-width: 767px) { 26 | .container { width:300px; } 27 | } 28 | 29 | 30 | /* Mobile (Landscape) 31 | ================================================== */ 32 | 33 | @media only screen and (min-width: 480px) and (max-width: 767px) { 34 | .container { width:420px; } 35 | } 36 | 37 | 38 | /* CSS Reset 39 | ================================================== */ 40 | 41 | html,body,div,span,h1,h6,p,a,ul,li,audio { 42 | border:0; 43 | font:inherit; 44 | font-size:100%; 45 | margin:0; 46 | padding:0; 47 | vertical-align:baseline; 48 | } 49 | 50 | body { line-height:1; } 51 | ul { list-style:none; } 52 | 53 | 54 | /* Basic Styles 55 | ================================================== */ 56 | 57 | html,body { 58 | -webkit-font-smoothing:antialiased; 59 | -webkit-text-size-adjust:100%; 60 | background-color:#111; 61 | color:#C8C7C8; 62 | font:20px/24px "Yanone Kaffeesatz", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif; 63 | font-weight:300; 64 | padding:5px 0; 65 | } 66 | 67 | * { 68 | -webkit-tap-highlight-color:rgba(0,0,0,0); 69 | -webkit-tap-highlight-color:transparent; 70 | } 71 | 72 | 73 | /* Typography 74 | ================================================== */ 75 | 76 | h1,h6,p { color:#808080; font-weight:200; } 77 | h1 { font-size:42px; line-height:44px; margin:20px 0 0; } 78 | h6 { font-size:18px; line-height:20px; margin:4px 0 20px; } 79 | p { font-size:18px; line-height:20px; margin:0 0 2px; } 80 | 81 | 82 | /* Links 83 | ================================================== */ 84 | 85 | a,a:visited { color:#ddd; outline:0; text-decoration:underline; } 86 | a:hover,a:focus { color:#bbb; } 87 | p a,p a:visited { line-height:inherit; } 88 | 89 | 90 | /* Misc. 91 | ================================================== */ 92 | 93 | .add-bottom { margin-bottom:20px !important; } 94 | .left { float:left; } 95 | .right { float:right; } 96 | .center { text-align:center; } 97 | 98 | 99 | /* Custom Styles 100 | ================================================== */ 101 | 102 | /* Highlight Styles */ 103 | ::selection { background-color:#262223; color:#444; } 104 | 105 | 106 | /* Audio Player Styles 107 | ================================================== */ 108 | 109 | /* Default / Desktop / Firefox */ 110 | audio { margin:0 15px 0 14px; width:670px; } 111 | #mainwrap { box-shadow:0 0 6px 1px rgba(0,0,0,.25); } 112 | #audiowrap { background-color:#231F20; margin:0 auto; } 113 | #plwrap { margin:0 auto; } 114 | #tracks { position:relative; text-align:center; } 115 | #nowPlay { display:inline; } 116 | #npTitle { margin:0; padding:21px; text-align:right; } 117 | #npAction { padding:21px; position:absolute; } 118 | #plList { margin:0; } 119 | #plList li { background-color:#231F20; cursor:pointer; display:block; margin:0; padding:21px 0; } 120 | #plList li:hover { background-color:#262223; } 121 | .plItem { position:relative; } 122 | .plTitle { left:50px; overflow:hidden; position:absolute; right:65px; text-overflow:ellipsis; top:0; white-space:nowrap; } 123 | .plNum { padding-left:21px; width:25px; } 124 | .plLength { padding-left:21px; position:absolute; right:21px; top:0; } 125 | .plSel,.plSel:hover { background-color:#262223!important; cursor:default!important; } 126 | a[id^="btn"] { background-color:#231F20; color:#C8C7C8; cursor:pointer; display:inline-block; font-size:50px; margin:0; padding:21px 27px; text-decoration:none; } 127 | a[id^="btn"]:last-child { margin-left:-4px; } 128 | a[id^="btn"]:hover,a[id^="btn"]:active { background-color:#262223; } 129 | a[id^="btn"]::-moz-focus-inner { border:0; padding:0; } 130 | 131 | /* IE 9 */ 132 | html[data-useragent*="MSIE 9.0"] audio { margin-left:9px; outline:none; width:680px; } 133 | html[data-useragent*="MSIE 9.0"] #audiowrap { background-color:#000; } 134 | html[data-useragent*="MSIE 9.0"] a[id^="btn"] { background-color:#000; } 135 | html[data-useragent*="MSIE 9.0"] a[id^="btn"]:hover { background-color:#080808; } 136 | html[data-useragent*="MSIE 9.0"] #plList li { background-color:#000; } 137 | html[data-useragent*="MSIE 9.0"] #plList li:hover { background-color:#080808; } 138 | html[data-useragent*="MSIE 9.0"] .plSel, 139 | html[data-useragent*="MSIE 9.0"] .plSel:hover { background-color:#080808!important; } 140 | 141 | /* IE 10 */ 142 | html[data-useragent*="MSIE 10.0"] audio { margin-left:6px; width:687px; } 143 | html[data-useragent*="MSIE 10.0"] #audiowrap { background-color:#000; } 144 | html[data-useragent*="MSIE 10.0"] a[id^="btn"] { background-color:#000; } 145 | html[data-useragent*="MSIE 10.0"] a[id^="btn"]:hover { background-color:#080808; } 146 | html[data-useragent*="MSIE 10.0"] #plList li { background-color:#000; } 147 | html[data-useragent*="MSIE 10.0"] #plList li:hover { background-color:#080808; } 148 | html[data-useragent*="MSIE 10.0"] .plSel, 149 | html[data-useragent*="MSIE 10.0"] .plSel:hover { background-color:#080808!important; } 150 | 151 | /* IE 11 */ 152 | html[data-useragent*="rv:11.0"] audio { margin-left:2px; width:695px; } 153 | html[data-useragent*="rv:11.0"] #audiowrap { background-color:#000; } 154 | html[data-useragent*="rv:11.0"] a[id^="btn"] { background-color:#000; } 155 | html[data-useragent*="rv:11.0"] a[id^="btn"]:hover { background-color:#080808; } 156 | html[data-useragent*="rv:11.0"] #plList li { background-color:#000; } 157 | html[data-useragent*="rv:11.0"] #plList li:hover { background-color:#080808; } 158 | html[data-useragent*="rv:11.0"] .plSel, 159 | html[data-useragent*="rv:11.0"] .plSel:hover { background-color:#080808!important; } 160 | 161 | /* All Apple Products */ 162 | html[data-useragent*="Apple"] audio { margin:0; width:100%; } 163 | html[data-useragent*="Apple"] #audiowrap { background-color:#000; } 164 | html[data-useragent*="Apple"] a[id^="btn"] { background-color:#000; } 165 | html[data-useragent*="Apple"] a[id^="btn"]:hover { background-color:#080808; } 166 | html[data-useragent*="Apple"] #plList li { background-color:#000; } 167 | html[data-useragent*="Apple"] #plList li:hover { background-color:#080808; } 168 | html[data-useragent*="Apple"] .plSel, 169 | html[data-useragent*="Apple"] .plSel:hover { background-color:#080808!important; } 170 | 171 | /* IOS 7 */ 172 | html[data-useragent*="OS 7"] body { color:#373837; } 173 | html[data-useragent*="OS 7"] audio { margin-left:3px; width:690px; } 174 | html[data-useragent*="OS 7"] #audiowrap { background-color:#e6e6e6; } 175 | html[data-useragent*="OS 7"] a[id^="btn"] { background-color:#e6e6e6; color:#373837; } 176 | html[data-useragent*="OS 7"] a[id^="btn"]:hover { background-color:#eee; } 177 | html[data-useragent*="OS 7"] #plList li { background-color:#e6e6e6; } 178 | html[data-useragent*="OS 7"] #plList li:hover { background-color:#eee; } 179 | html[data-useragent*="OS 7"] .plSel, 180 | html[data-useragent*="OS 7"] .plSel:hover { background-color:#eee!important; } 181 | 182 | /* IOS 8 */ 183 | html[data-useragent*="OS 8"] body { color:#373837; } 184 | html[data-useragent*="OS 8"] audio { margin-left:6px; width:694px; } 185 | html[data-useragent*="OS 8"] #audiowrap { background-color:#e4e4e4; } 186 | html[data-useragent*="OS 8"] a[id^="btn"] { background-color:#e4e4e4; color:#373837; } 187 | html[data-useragent*="OS 8"] a[id^="btn"]:hover { background-color:#eee; } 188 | html[data-useragent*="OS 8"] #plList li { background-color:#e4e4e4; } 189 | html[data-useragent*="OS 8"] #plList li:hover { background-color:#eee; } 190 | html[data-useragent*="OS 8"] .plSel, 191 | html[data-useragent*="OS 8"] .plSel:hover { background-color:#eee!important; } 192 | 193 | /* IOS 9 */ 194 | html[data-useragent*="OS 9"] body { color:#373837; } 195 | html[data-useragent*="OS 9"] audio { margin-left:6px; width:694px; } 196 | html[data-useragent*="OS 9"] #audiowrap { background-color:#d5d5d5; } 197 | html[data-useragent*="OS 9"] a[id^="btn"] { background-color:#d5d5d5; color:#373837; } 198 | html[data-useragent*="OS 9"] a[id^="btn"]:hover { background-color:#eee; } 199 | html[data-useragent*="OS 9"] #plList li { background-color:#d5d5d5; } 200 | html[data-useragent*="OS 9"] #plList li:hover { background-color:#eee; } 201 | html[data-useragent*="OS 9"] .plSel, 202 | html[data-useragent*="OS 9"] .plSel:hover { background-color:#eee!important; } 203 | 204 | /* Chrome */ 205 | html[data-useragent*="Chrome"] body { color:#5a5a5a; } 206 | html[data-useragent*="Chrome"] audio { margin-left:9px; width:677px; } 207 | html[data-useragent*="Chrome"] #audiowrap { background-color:#fafafa; } 208 | html[data-useragent*="Chrome"] a[id^="btn"] { background-color:#fafafa; color:#5a5a5a; } 209 | html[data-useragent*="Chrome"] a[id^="btn"]:hover { background-color:#eee; } 210 | html[data-useragent*="Chrome"] #plList li { background-color:#fafafa; } 211 | html[data-useragent*="Chrome"] #plList li:hover { background-color:#eee; } 212 | html[data-useragent*="Chrome"] .plSel, 213 | html[data-useragent*="Chrome"] .plSel:hover { background-color:#eee!important; } 214 | 215 | /* Chrome / Android / Tablet */ 216 | html[data-useragent*="Chrome"][data-useragent*="Android"] body { color:#373837; } 217 | html[data-useragent*="Chrome"][data-useragent*="Android"] audio { margin-left:4px; width:689px; } 218 | html[data-useragent*="Chrome"][data-useragent*="Android"] #audiowrap { background-color:#fafafa; } 219 | html[data-useragent*="Chrome"][data-useragent*="Android"] a[id^="btn"] { background-color:#fafafa; color:#373837; } 220 | html[data-useragent*="Chrome"][data-useragent*="Android"] a[id^="btn"]:hover { background-color:#eee; } 221 | html[data-useragent*="Chrome"][data-useragent*="Android"] #plList li { background-color:#fafafa; } 222 | html[data-useragent*="Chrome"][data-useragent*="Android"] #plList li:hover { background-color:#eee; } 223 | html[data-useragent*="Chrome"][data-useragent*="Android"] .plSel, 224 | html[data-useragent*="Chrome"][data-useragent*="Android"] .plSel:hover { background-color:#eee!important; } 225 | 226 | 227 | /* Audio Player Media Queries 228 | ================================================== */ 229 | 230 | /* Tablet Portrait */ 231 | @media only screen and (min-width: 768px) and (max-width: 959px) { 232 | audio { width:526px; } 233 | html[data-useragent*="MSIE 9.0"] audio { width:536px; } 234 | html[data-useragent*="MSIE 10.0"] audio { width:543px; } 235 | html[data-useragent*="rv:11.0"] audio { width:551px; } 236 | html[data-useragent*="OS 7"] audio { width:546px; } 237 | html[data-useragent*="OS 8"] audio { width:550px; } 238 | html[data-useragent*="OS 9"] audio { width:550px; } 239 | html[data-useragent*="Chrome"] audio { width:533px; } 240 | html[data-useragent*="Chrome"][data-useragent*="Android"] audio { margin-left:4px; width:545px; } 241 | } 242 | 243 | /* Mobile Landscape */ 244 | @media only screen and (min-width: 480px) and (max-width: 767px) { 245 | audio { width:390px; } 246 | html[data-useragent*="MSIE 9.0"] audio { width:400px; } 247 | html[data-useragent*="MSIE 10.0"] audio { width:407px; } 248 | html[data-useragent*="rv:11.0"] audio { width:415px; } 249 | html[data-useragent*="OS 7"] audio { width:410px; } 250 | html[data-useragent*="OS 8"] audio { width:414px; } 251 | html[data-useragent*="OS 9"] audio { width:414px; } 252 | html[data-useragent*="Chrome"] audio { width:397px; } 253 | html[data-useragent*="Chrome"][data-useragent*="Mobile"] audio { margin-left:4px; width:410px; } 254 | #npTitle { width:245px; } 255 | } 256 | 257 | /* Mobile Portrait */ 258 | @media only screen and (max-width: 479px) { 259 | audio { width:270px; } 260 | html[data-useragent*="MSIE 9.0"] audio { width:280px; } 261 | html[data-useragent*="MSIE 10.0"] audio { width:287px; } 262 | html[data-useragent*="rv:11.0"] audio { width:295px; } 263 | html[data-useragent*="OS 7"] audio { width:290px; } 264 | html[data-useragent*="OS 8"] audio { width:294px; } 265 | html[data-useragent*="OS 9"] audio { width:294px; } 266 | html[data-useragent*="Chrome"] audio { width:277px; } 267 | html[data-useragent*="Chrome"][data-useragent*="Mobile"] audio { margin-left:4px; width:290px; } 268 | #npTitle { width:167px; } 269 | } -------------------------------------------------------------------------------- /playlistfromsong/assets/css/style2.css: -------------------------------------------------------------------------------- 1 | /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ 2 | /* Font Family 3 | ================================================== */ 4 | 5 | @import url("//fonts.googleapis.com/css?family=Yanone+Kaffeesatz:200,300,400"); 6 | 7 | 8 | /* Desktop 9 | ================================================== */ 10 | 11 | .container { position:relative; margin:0 auto; width:700px; } 12 | .column { width:inherit; } 13 | 14 | 15 | /* Tablet (Portrait) 16 | ================================================== */ 17 | 18 | @media only screen and (min-width: 768px) and (max-width: 959px) { 19 | .container { width:556px; } 20 | } 21 | 22 | 23 | /* Mobile (Portrait) 24 | ================================================== */ 25 | 26 | @media only screen and (max-width: 767px) { 27 | .container { width:300px; } 28 | } 29 | 30 | 31 | /* Mobile (Landscape) 32 | ================================================== */ 33 | 34 | @media only screen and (min-width: 480px) and (max-width: 767px) { 35 | .container { width:420px; } 36 | } 37 | 38 | 39 | /* CSS Reset 40 | ================================================== */ 41 | 42 | html,body,div,span,h1,h6,p,a,ul,li,audio { 43 | border:0; 44 | font:inherit; 45 | font-size:100%; 46 | margin:0; 47 | padding:0; 48 | vertical-align:baseline; 49 | } 50 | 51 | body { line-height:1; } 52 | ul { list-style:none; } 53 | 54 | 55 | /* Basic Styles 56 | ================================================== */ 57 | 58 | html,body { 59 | -webkit-font-smoothing:antialiased; 60 | -webkit-text-size-adjust:100%; 61 | background-color:#111; 62 | color:#C8C7C8; 63 | font:20px/24px "Yanone Kaffeesatz", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif; 64 | font-weight:300; 65 | padding:5px 0; 66 | } 67 | 68 | * { 69 | -webkit-tap-highlight-color:rgba(0,0,0,0); 70 | -webkit-tap-highlight-color:transparent; 71 | } 72 | 73 | 74 | /* Typography 75 | ================================================== */ 76 | 77 | h1,h6,p { color:#808080; font-weight:200; } 78 | h1 { font-size:42px; line-height:44px; margin:20px 0 0; } 79 | h6 { font-size:18px; line-height:20px; margin:4px 0 20px; } 80 | p { font-size:18px; line-height:20px; margin:0 0 2px; } 81 | 82 | 83 | /* Links 84 | ================================================== */ 85 | 86 | a,a:visited { color:#ddd; outline:0; text-decoration:underline; } 87 | a:hover,a:focus { color:#bbb; } 88 | p a,p a:visited { line-height:inherit; } 89 | 90 | 91 | /* Misc. 92 | ================================================== */ 93 | 94 | .add-bottom { margin-bottom:20px !important; } 95 | .left { float:left; } 96 | .right { float:right; } 97 | .center { text-align:center; } 98 | 99 | 100 | /* Custom Styles 101 | ================================================== */ 102 | 103 | /* Highlight Styles */ 104 | ::selection { background-color:#262223; color:#444; } 105 | 106 | 107 | /* Audio Player Styles 108 | ================================================== */ 109 | 110 | /* Default / Desktop / Firefox */ 111 | audio { margin:0 15px 0 14px; width:670px; } 112 | #mainwrap { box-shadow:0 0 6px 1px rgba(0,0,0,.25); } 113 | #audiowrap { background-color:#231F20; margin:0 auto; } 114 | #plwrap { margin:0 auto; } 115 | #tracks { position:relative; text-align:center; } 116 | #nowPlay { display:inline; } 117 | #npTitle { margin:0; padding:21px; text-align:right; } 118 | #npAction { padding:21px; position:absolute; } 119 | #plList { margin:0; } 120 | #plList li { background-color:#231F20; cursor:pointer; display:block; margin:0; padding:21px 0; } 121 | #plList li:hover { background-color:#262223; } 122 | .plItem { position:relative; } 123 | .plTitle { left:50px; overflow:hidden; position:absolute; right:65px; text-overflow:ellipsis; top:0; white-space:nowrap; } 124 | .plNum { padding-left:21px; width:25px; } 125 | .plLength { padding-left:21px; position:absolute; right:21px; top:0; } 126 | .plSel,.plSel:hover { background-color:#262223!important; cursor:default!important; } 127 | a[id^="btn"] { background-color:#231F20; color:#C8C7C8; cursor:pointer; display:inline-block; font-size:50px; margin:0; padding:21px 27px; text-decoration:none; } 128 | a[id^="btn"]:last-child { margin-left:-4px; } 129 | a[id^="btn"]:hover,a[id^="btn"]:active { background-color:#262223; } 130 | a[id^="btn"]::-moz-focus-inner { border:0; padding:0; } 131 | 132 | /* IE 9 */ 133 | html[data-useragent*="MSIE 9.0"] audio { margin-left:9px; outline:none; width:680px; } 134 | html[data-useragent*="MSIE 9.0"] #audiowrap { background-color:#000; } 135 | html[data-useragent*="MSIE 9.0"] a[id^="btn"] { background-color:#000; } 136 | html[data-useragent*="MSIE 9.0"] a[id^="btn"]:hover { background-color:#080808; } 137 | html[data-useragent*="MSIE 9.0"] #plList li { background-color:#000; } 138 | html[data-useragent*="MSIE 9.0"] #plList li:hover { background-color:#080808; } 139 | html[data-useragent*="MSIE 9.0"] .plSel, 140 | html[data-useragent*="MSIE 9.0"] .plSel:hover { background-color:#080808!important; } 141 | 142 | /* IE 10 */ 143 | html[data-useragent*="MSIE 10.0"] audio { margin-left:6px; width:687px; } 144 | html[data-useragent*="MSIE 10.0"] #audiowrap { background-color:#000; } 145 | html[data-useragent*="MSIE 10.0"] a[id^="btn"] { background-color:#000; } 146 | html[data-useragent*="MSIE 10.0"] a[id^="btn"]:hover { background-color:#080808; } 147 | html[data-useragent*="MSIE 10.0"] #plList li { background-color:#000; } 148 | html[data-useragent*="MSIE 10.0"] #plList li:hover { background-color:#080808; } 149 | html[data-useragent*="MSIE 10.0"] .plSel, 150 | html[data-useragent*="MSIE 10.0"] .plSel:hover { background-color:#080808!important; } 151 | 152 | /* IE 11 */ 153 | html[data-useragent*="rv:11.0"] audio { margin-left:2px; width:695px; } 154 | html[data-useragent*="rv:11.0"] #audiowrap { background-color:#000; } 155 | html[data-useragent*="rv:11.0"] a[id^="btn"] { background-color:#000; } 156 | html[data-useragent*="rv:11.0"] a[id^="btn"]:hover { background-color:#080808; } 157 | html[data-useragent*="rv:11.0"] #plList li { background-color:#000; } 158 | html[data-useragent*="rv:11.0"] #plList li:hover { background-color:#080808; } 159 | html[data-useragent*="rv:11.0"] .plSel, 160 | html[data-useragent*="rv:11.0"] .plSel:hover { background-color:#080808!important; } 161 | 162 | /* All Apple Products */ 163 | html[data-useragent*="Apple"] audio { margin:0; width:100%; } 164 | html[data-useragent*="Apple"] #audiowrap { background-color:#000; } 165 | html[data-useragent*="Apple"] a[id^="btn"] { background-color:#000; } 166 | html[data-useragent*="Apple"] a[id^="btn"]:hover { background-color:#080808; } 167 | html[data-useragent*="Apple"] #plList li { background-color:#000; } 168 | html[data-useragent*="Apple"] #plList li:hover { background-color:#080808; } 169 | html[data-useragent*="Apple"] .plSel, 170 | html[data-useragent*="Apple"] .plSel:hover { background-color:#080808!important; } 171 | 172 | /* IOS 7 */ 173 | html[data-useragent*="OS 7"] body { color:#373837; } 174 | html[data-useragent*="OS 7"] audio { margin-left:3px; width:690px; } 175 | html[data-useragent*="OS 7"] #audiowrap { background-color:#e6e6e6; } 176 | html[data-useragent*="OS 7"] a[id^="btn"] { background-color:#e6e6e6; color:#373837; } 177 | html[data-useragent*="OS 7"] a[id^="btn"]:hover { background-color:#eee; } 178 | html[data-useragent*="OS 7"] #plList li { background-color:#e6e6e6; } 179 | html[data-useragent*="OS 7"] #plList li:hover { background-color:#eee; } 180 | html[data-useragent*="OS 7"] .plSel, 181 | html[data-useragent*="OS 7"] .plSel:hover { background-color:#eee!important; } 182 | 183 | /* IOS 8 */ 184 | html[data-useragent*="OS 8"] body { color:#373837; } 185 | html[data-useragent*="OS 8"] audio { margin-left:6px; width:694px; } 186 | html[data-useragent*="OS 8"] #audiowrap { background-color:#e4e4e4; } 187 | html[data-useragent*="OS 8"] a[id^="btn"] { background-color:#e4e4e4; color:#373837; } 188 | html[data-useragent*="OS 8"] a[id^="btn"]:hover { background-color:#eee; } 189 | html[data-useragent*="OS 8"] #plList li { background-color:#e4e4e4; } 190 | html[data-useragent*="OS 8"] #plList li:hover { background-color:#eee; } 191 | html[data-useragent*="OS 8"] .plSel, 192 | html[data-useragent*="OS 8"] .plSel:hover { background-color:#eee!important; } 193 | 194 | /* IOS 9 */ 195 | html[data-useragent*="OS 9"] body { color:#373837; } 196 | html[data-useragent*="OS 9"] audio { margin-left:6px; width:694px; } 197 | html[data-useragent*="OS 9"] #audiowrap { background-color:#d5d5d5; } 198 | html[data-useragent*="OS 9"] a[id^="btn"] { background-color:#d5d5d5; color:#373837; } 199 | html[data-useragent*="OS 9"] a[id^="btn"]:hover { background-color:#eee; } 200 | html[data-useragent*="OS 9"] #plList li { background-color:#d5d5d5; } 201 | html[data-useragent*="OS 9"] #plList li:hover { background-color:#eee; } 202 | html[data-useragent*="OS 9"] .plSel, 203 | html[data-useragent*="OS 9"] .plSel:hover { background-color:#eee!important; } 204 | 205 | /* Chrome */ 206 | html[data-useragent*="Chrome"] body { color:#5a5a5a; } 207 | html[data-useragent*="Chrome"] audio { margin-left:9px; width:677px; } 208 | html[data-useragent*="Chrome"] #audiowrap { background-color:#fafafa; } 209 | html[data-useragent*="Chrome"] a[id^="btn"] { background-color:#fafafa; color:#5a5a5a; } 210 | html[data-useragent*="Chrome"] a[id^="btn"]:hover { background-color:#eee; } 211 | html[data-useragent*="Chrome"] #plList li { background-color:#fafafa; } 212 | html[data-useragent*="Chrome"] #plList li:hover { background-color:#eee; } 213 | html[data-useragent*="Chrome"] .plSel, 214 | html[data-useragent*="Chrome"] .plSel:hover { background-color:#eee!important; } 215 | 216 | /* Chrome / Android / Tablet */ 217 | html[data-useragent*="Chrome"][data-useragent*="Android"] body { color:#373837; } 218 | html[data-useragent*="Chrome"][data-useragent*="Android"] audio { margin-left:4px; width:689px; } 219 | html[data-useragent*="Chrome"][data-useragent*="Android"] #audiowrap { background-color:#fafafa; } 220 | html[data-useragent*="Chrome"][data-useragent*="Android"] a[id^="btn"] { background-color:#fafafa; color:#373837; } 221 | html[data-useragent*="Chrome"][data-useragent*="Android"] a[id^="btn"]:hover { background-color:#eee; } 222 | html[data-useragent*="Chrome"][data-useragent*="Android"] #plList li { background-color:#fafafa; } 223 | html[data-useragent*="Chrome"][data-useragent*="Android"] #plList li:hover { background-color:#eee; } 224 | html[data-useragent*="Chrome"][data-useragent*="Android"] .plSel, 225 | html[data-useragent*="Chrome"][data-useragent*="Android"] .plSel:hover { background-color:#eee!important; } 226 | 227 | 228 | /* Audio Player Media Queries 229 | ================================================== */ 230 | 231 | /* Tablet Portrait */ 232 | @media only screen and (min-width: 768px) and (max-width: 959px) { 233 | audio { width:526px; } 234 | html[data-useragent*="MSIE 9.0"] audio { width:536px; } 235 | html[data-useragent*="MSIE 10.0"] audio { width:543px; } 236 | html[data-useragent*="rv:11.0"] audio { width:551px; } 237 | html[data-useragent*="OS 7"] audio { width:546px; } 238 | html[data-useragent*="OS 8"] audio { width:550px; } 239 | html[data-useragent*="OS 9"] audio { width:550px; } 240 | html[data-useragent*="Chrome"] audio { width:533px; } 241 | html[data-useragent*="Chrome"][data-useragent*="Android"] audio { margin-left:4px; width:545px; } 242 | } 243 | 244 | /* Mobile Landscape */ 245 | @media only screen and (min-width: 480px) and (max-width: 767px) { 246 | audio { width:390px; } 247 | html[data-useragent*="MSIE 9.0"] audio { width:400px; } 248 | html[data-useragent*="MSIE 10.0"] audio { width:407px; } 249 | html[data-useragent*="rv:11.0"] audio { width:415px; } 250 | html[data-useragent*="OS 7"] audio { width:410px; } 251 | html[data-useragent*="OS 8"] audio { width:414px; } 252 | html[data-useragent*="OS 9"] audio { width:414px; } 253 | html[data-useragent*="Chrome"] audio { width:397px; } 254 | html[data-useragent*="Chrome"][data-useragent*="Mobile"] audio { margin-left:4px; width:410px; } 255 | #npTitle { width:245px; } 256 | } 257 | 258 | /* Mobile Portrait */ 259 | @media only screen and (max-width: 479px) { 260 | audio { width:270px; } 261 | html[data-useragent*="MSIE 9.0"] audio { width:280px; } 262 | html[data-useragent*="MSIE 10.0"] audio { width:287px; } 263 | html[data-useragent*="rv:11.0"] audio { width:295px; } 264 | html[data-useragent*="OS 7"] audio { width:290px; } 265 | html[data-useragent*="OS 8"] audio { width:294px; } 266 | html[data-useragent*="OS 9"] audio { width:294px; } 267 | html[data-useragent*="Chrome"] audio { width:277px; } 268 | html[data-useragent*="Chrome"][data-useragent*="Mobile"] audio { margin-left:4px; width:290px; } 269 | #npTitle { width:167px; } 270 | } -------------------------------------------------------------------------------- /playlistfromsong/assets/js/html5media.min.js: -------------------------------------------------------------------------------- 1 | !function(){function e(e){console.log("$f.fireEvent",[].slice.call(e))}function t(e){if(!e||"object"!=typeof e)return e;var n=new e.constructor;for(var r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}function n(e,t){if(e){var n,r=0,i=e.length;if(void 0===i){for(n in e)if(t.call(e[n],n,e[n])===!1)break}else for(var o=e[0];i>r&&t.call(o,r,o)!==!1;o=e[++r]);return e}}function r(e){return document.getElementById(e)}function i(e,t,r){return"object"!=typeof t?e:(e&&t&&n(t,function(t,n){r&&"function"==typeof n||(e[t]=n)}),e)}function o(e){var t=e.indexOf(".");if(-1!=t){var r=e.slice(0,t)||"*",i=e.slice(t+1,e.length),o=[];return n(document.getElementsByTagName(r),function(){this.className&&-1!=this.className.indexOf(i)&&o.push(this)}),o}}function a(e){return e=e||window.event,e.preventDefault?(e.stopPropagation(),e.preventDefault()):(e.returnValue=!1,e.cancelBubble=!0),!1}function u(e,t,n){e[t]=e[t]||[],e[t].push(n)}function l(){return"_"+(""+Math.random()).slice(2,10)}function s(o,s,f){function g(){function e(e){var t=S.hasiPadSupport&&S.hasiPadSupport();return!/iPad|iPhone|iPod/i.test(navigator.userAgent)||/.flv$/i.test(C[0].url)||t?(S.isLoaded()||S._fireEvent("onBeforeClick")===!1||S.load(),a(e)):!0}function t(){""!==h.replace(/\s/g,"")?o.addEventListener?o.addEventListener("click",e,!1):o.attachEvent&&o.attachEvent("onclick",e):(o.addEventListener&&o.addEventListener("click",a,!1),S.load())}$f(o)?($f(o).getParent().innerHTML="",w=$f(o).getIndex(),p[w]=S):(p.push(S),w=p.length-1),E=parseInt(o.style.height,10)||o.clientHeight,y=o.id||"fp"+l(),m=s.id||y+"_api",s.id=m,f.playerId=y,"string"==typeof f&&(f={clip:{url:f}}),"string"==typeof f.clip&&(f.clip={url:f.clip}),f.clip=f.clip||{},o.getAttribute("href",2)&&!f.clip.url&&(f.clip.url=o.getAttribute("href",2)),v=new c(f.clip,-1,S),f.playlist=f.playlist||[f.clip];var r=0;n(f.playlist,function(){var e=this;"object"==typeof e&&e.length&&(e={url:""+e}),n(f.clip,function(t,n){void 0!==n&&void 0===e[t]&&"function"!=typeof n&&(e[t]=n)}),f.playlist[r]=e,e=new c(e,r,S),C.push(e),r++}),n(f,function(e,t){"function"==typeof t&&(v[e]?v[e](t):u(x,e,t),delete f[e])}),n(f.plugins,function(e,t){t&&(k[e]=new d(e,t,S))}),f.plugins&&void 0!==f.plugins.controls||(k.controls=new d("controls",null,S)),k.canvas=new d("canvas",null,S),h=o.innerHTML,setTimeout(t,0)}var h,v,y,m,w,b,_,E,S=this,L=null,P=!1,C=[],k={},x={};if(i(S,{id:function(){return y},isLoaded:function(){return null!==L&&void 0!==L.fp_play&&!P},getParent:function(){return o},hide:function(e){return e&&(o.style.height="0px"),S.isLoaded()&&(L.style.height="0px"),S},show:function(){return o.style.height=E+"px",S.isLoaded()&&(L.style.height=_+"px"),S},isHidden:function(){return S.isLoaded()&&0===parseInt(L.style.height,10)},load:function(e){if(!S.isLoaded()&&S._fireEvent("onBeforeLoad")!==!1){var t=function(){h=o.innerHTML,h&&!flashembed.isSupported(s.version)&&(o.innerHTML=""),e&&(e.cached=!0,u(x,"onLoad",e)),flashembed(o,s,{config:f})},r=0;n(p,function(){this.unload(function(){++r==p.length&&t()})})}return S},unload:function(e){if(this.isFullscreen()&&/WebKit/i.test(navigator.userAgent))return e&&e(!1),S;if(""!==h.replace(/\s/g,"")){if(S._fireEvent("onBeforeUnload")===!1)return e&&e(!1),S;P=!0;try{L&&(L.fp_close(),S._fireEvent("onUnload"))}catch(t){}var n=function(){L=null,o.innerHTML=h,P=!1,e&&e(!0)};setTimeout(n,50)}else e&&e(!1);return S},getClip:function(e){return void 0===e&&(e=b),C[e]},getCommonClip:function(){return v},getPlaylist:function(){return C},getPlugin:function(e){var t=k[e];if(!t&&S.isLoaded()){var n=S._api().fp_getPlugin(e);n&&(t=new d(e,n,S),k[e]=t)}return t},getScreen:function(){return S.getPlugin("screen")},getControls:function(){return S.getPlugin("controls")._fireEvent("onUpdate")},getLogo:function(){try{return S.getPlugin("logo")._fireEvent("onUpdate")}catch(e){}},getPlay:function(){return S.getPlugin("play")._fireEvent("onUpdate")},getConfig:function(e){return e?t(f):f},getFlashParams:function(){return s},loadPlugin:function(e,t,n,r){"function"==typeof n&&(r=n,n={});var i=r?l():"_";S._api().fp_loadPlugin(e,t,n,i);var o={};o[i]=r;var a=new d(e,null,S,o);return k[e]=a,a},getState:function(){return S.isLoaded()?L.fp_getState():-1},play:function(e,t){var n=function(){void 0!==e?S._api().fp_play(e,t):S._api().fp_play()};return S.isLoaded()?n():P?setTimeout(function(){S.play(e,t)},50):S.load(function(){n()}),S},getVersion:function(){var e="flowplayer.js 3.2.6";if(S.isLoaded()){var t=L.fp_getVersion();return t.push(e),t}return e},_api:function(){if(!S.isLoaded())throw"Flowplayer "+S.id()+" not loaded when calling an API method";return L},setClip:function(e){return S.setPlaylist([e]),S},getIndex:function(){return w},_swfHeight:function(){return L.clientHeight}}),n("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut".split(","),function(){var e="on"+this;if(-1!=e.indexOf("*")){e=e.slice(0,e.length-1);var t="onBefore"+e.slice(2);S[t]=function(e){return u(x,t,e),S}}S[e]=function(t){return u(x,e,t),S}}),n("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled".split(","),function(){var e=this;S[e]=function(t,n){if(!S.isLoaded())return S;var r=null;return r=void 0!==t&&void 0!==n?L["fp_"+e](t,n):void 0===t?L["fp_"+e]():L["fp_"+e](t),"undefined"===r||void 0===r?S:r}}),S._fireEvent=function(t){"string"==typeof t&&(t=[t]);var i=t[0],o=t[1],a=t[2],u=t[3],l=0;if(f.debug&&e(t),S.isLoaded()||"onLoad"!=i||"player"!=o||(L=L||r(m),_=S._swfHeight(),n(C,function(){this._fireEvent("onLoad")}),n(k,function(e,t){t._fireEvent("onUpdate")}),v._fireEvent("onLoad")),"onLoad"!=i||"player"==o){if("onError"==i&&("string"==typeof o||"number"==typeof o&&"number"==typeof a)&&(o=a,a=u),"onContextMenu"==i)return void n(f.contextMenu[o],function(e,t){t.call(S)});if("onPluginEvent"!=i&&"onBeforePluginEvent"!=i){if("onPlaylistReplace"==i){C=[];var s=0;n(o,function(){C.push(new c(this,s++,S))})}if("onClipAdd"==i){if(o.isInStream)return;for(o=new c(o,a,S),C.splice(a,0,o),l=a+1;l1){var u=arguments[1],l=3==arguments.length?arguments[2]:{};if("string"==typeof u&&(u={src:u}),u=i({bgcolor:"#000000",version:[9,0],expressInstall:"http://static.flowplayer.org/swf/expressinstall.swf",cachebusting:!1},u),"string"==typeof a){if(-1!=a.indexOf(".")){var c=[];return n(o(a),function(){c.push(new s(this,t(u),t(l)))}),new f(c)}var d=r(a);return new s(null!==d?d:a,u,l)}if(a)return new s(a,u,l)}return null},i(window.$f,{fireEvent:function(){var e=[].slice.call(arguments),t=$f(e[0]);return t?t._fireEvent(e.slice(1)):null},addPlugin:function(e,t){return s.prototype[e]=t,$f},each:n,extend:i}),"function"==typeof jQuery&&(jQuery.fn.flowplayer=function(e,n){if(!arguments.length||"number"==typeof arguments[0]){var r=[];return this.each(function(){var e=$f(this);e&&r.push(e)}),arguments.length?r[arguments[0]]:new f(r)}return this.each(function(){$f(this,t(e),n?t(n):{})})})}(),function(){function e(){if(s.done)return!1;var e=document;if(e&&e.getElementsByTagName&&e.getElementById&&e.body){clearInterval(s.timer),s.timer=null;for(var t=0;t'),i.width=i.height=i.id=i.w3c=i.src=null;for(var u in i)null!==i[u]&&(a+='');var l="";if(r){for(var s in r)null!==r[s]&&(l+=s+"="+("object"==typeof r[s]?n(r[s]):r[s])+"&");l=l.substring(0,l.length-1),a+='"}return a+=""}function a(e,n,r){var i=flashembed.getVersion();t(this,{getContainer:function(){return e},getConf:function(){return n},getVersion:function(){return i},getFlashvars:function(){return r},getApi:function(){return e.firstChild},getHTML:function(){return o(n,r)}});var a=n.version,u=n.expressInstall,l=!a||flashembed.isSupported(a);if(l?(n.onFail=n.version=n.expressInstall=null,e.innerHTML=o(n,r)):a&&u&&flashembed.isSupported([6,65])?(t(n,{src:u}),r={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title},e.innerHTML=o(n,r)):""!==e.innerHTML.replace(/\s/g,"")||(e.innerHTML="

Flash version "+a+" or greater is required

"+(i[0]>0?"Your version is "+i:"You have no flash plugin installed")+"

"+("A"==e.tagName?"

Click here to download latest version

":"

Download latest version from here

"),"A"==e.tagName&&(e.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"})),!l&&n.onFail){var s=n.onFail.call(this);"string"==typeof s&&(e.innerHTML=s)}document.all&&(window[n.id]=document.getElementById(n.id))}var u="function"==typeof jQuery,l={width:"100%",height:"100%",allowfullscreen:!0,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:!1,cachebusting:!1};u&&(jQuery.tools=jQuery.tools||{},jQuery.tools.flashembed={version:"1.0.4",conf:l});var s=u?jQuery:function(t){return s.done?t():void(s.timer?s.ready.push(t):(s.ready=[t],s.timer=setInterval(e,13)))};window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){},__flash_savedUnloadHandler=function(){}}),window.flashembed=function(e,n,r){if("string"==typeof e){var i=document.getElementById(e);if(!i)return void s(function(){flashembed(e,n,r)});e=i}if(e){"string"==typeof n&&(n={src:n});var o=t({},l);return t(o,n),new a(e,o,r)}},t(window.flashembed,{getVersion:function(){var e=[0,0];if(navigator.plugins&&"object"==typeof navigator.plugins["Shockwave Flash"]){var t=navigator.plugins["Shockwave Flash"].description;if("undefined"!=typeof t){t=t.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var n=parseInt(t.replace(/^(.*)\..*$/,"$1"),10),r=/r/.test(t)?parseInt(t.replace(/^.*r(.*)$/,"$1"),10):0;e=[n,r]}}else if(window.ActiveXObject){try{var i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(o){try{i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),e=[6,0],i.AllowScriptAccess="always"}catch(a){if(6==e[0])return e}try{i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(u){}}"object"==typeof i&&(t=i.GetVariable("$version"),"undefined"!=typeof t&&(t=t.replace(/^\S+\s+(.*)$/,"$1").split(","),e=[parseInt(t[0],10),parseInt(t[2],10)]))}return e},isSupported:function(e){var t=flashembed.getVersion(),n=t[0]>e[0]||t[0]==e[0]&&t[1]>=e[1];return n},domReady:s,asString:n,getHTML:o}),u&&(jQuery.fn.flashembed=function(e,t){var n=null;return this.each(function(){n=flashembed(this,e,t)}),e.api===!1?this:n})}(),function(){function e(){if(!u&&(u=!0,l)){for(var e=0;e-1}function r(e){for(var r=t.getElementsByTagName(e),o=[],u=0;u and