diff --git a/.gitignore b/.gitignore index 5cf38bca..4db9faa4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ /build/ /dist/ -/*.egg-info/ +/MANIFEST +*.egg-info/ +*.py[cod] _*/ -*.py[cod] *.download *.cmt.* diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index d5dab196..00000000 --- a/MANIFEST +++ /dev/null @@ -1,21 +0,0 @@ -# file GENERATED by distutils, do NOT edit -CHANGELOG.txt -LICENSE.txt -Makefile -README.md -README.txt -setup.cfg -setup.py -you-get -you-get.json -you_get/__init__.py -you_get/common.py -you_get/main.py -you_get/downloader/__init__.py -you_get/downloader/tudou.py -you_get/downloader/yinyuetai.py -you_get/downloader/youku.py -you_get/downloader/youtube.py -you_get/processor/__init__.py -you_get/processor/merge_flv.py -you_get/processor/merge_mp4.py diff --git a/Makefile b/Makefile index eaec6c69..355a887f 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,12 @@ SETUP = python3 setup.py default: build sdist bdist bdist_egg +test: + $(SETUP) test + clean: zenity --question - rm -fr build/ dist/ *.egg-info/ + rm -fr build/ dist/ src/*.egg-info/ find . | grep __pycache__ | xargs rm -fr build: diff --git a/README.md b/README.md index 6ddea064..0ba30b1b 100644 --- a/README.md +++ b/README.md @@ -152,8 +152,8 @@ In Python 3 (interactive): >>> import you_get - >>> you_get.__version__ - '0.2' + >>> you_get.version.__version__ + '0.3' >>> you_get.youtube_download("http://www.youtube.com/watch?v=8bQlxQJEzLk", info_only = True) Video Site: YouTube.com diff --git a/README.txt b/README.txt index 5b3d550b..d4817a32 100644 --- a/README.txt +++ b/README.txt @@ -160,8 +160,8 @@ In Python 3 (interactive):: >>> import you_get - >>> you_get.__version__ - '0.2' + >>> you_get.version.__version__ + '0.3' >>> you_get.youtube_download("http://www.youtube.com/watch?v=8bQlxQJEzLk", info_only = True) Video Site: YouTube.com diff --git a/setup.py b/setup.py index a3506105..6564d33d 100755 --- a/setup.py +++ b/setup.py @@ -1,13 +1,16 @@ #!/usr/bin/env python3 -PROJ_METADATA = 'you-get.json' +PROJ_NAME = 'you-get' +PACKAGE_NAME = 'you_get' + +PROJ_METADATA = '%s.json' % PROJ_NAME import os, json, imp here = os.path.abspath(os.path.dirname(__file__)) proj_info = json.loads(open(os.path.join(here, PROJ_METADATA)).read()) README = open(os.path.join(here, 'README.txt')).read() CHANGELOG = open(os.path.join(here, 'CHANGELOG.txt')).read() -VERSION = imp.load_source('version', os.path.join(here, 'you_get/version.py')).__version__ +VERSION = imp.load_source('version', os.path.join(here, 'src/%s/version.py' % PACKAGE_NAME)).__version__ from setuptools import setup, find_packages setup( @@ -24,7 +27,10 @@ setup( long_description = README + '\n\n' + CHANGELOG, - packages = find_packages(), + packages = find_packages('src'), + package_dir = {'' : 'src'}, + + test_suite = 'tests', platforms = 'any', zip_safe = False, diff --git a/you_get/__init__.py b/src/you_get/__init__.py similarity index 100% rename from you_get/__init__.py rename to src/you_get/__init__.py diff --git a/you_get/common.py b/src/you_get/common.py similarity index 100% rename from you_get/common.py rename to src/you_get/common.py diff --git a/you_get/downloader/__init__.py b/src/you_get/downloader/__init__.py similarity index 100% rename from you_get/downloader/__init__.py rename to src/you_get/downloader/__init__.py diff --git a/you_get/downloader/acfun.py b/src/you_get/downloader/acfun.py similarity index 100% rename from you_get/downloader/acfun.py rename to src/you_get/downloader/acfun.py diff --git a/you_get/downloader/bilibili.py b/src/you_get/downloader/bilibili.py similarity index 100% rename from you_get/downloader/bilibili.py rename to src/you_get/downloader/bilibili.py diff --git a/you_get/downloader/cntv.py b/src/you_get/downloader/cntv.py similarity index 100% rename from you_get/downloader/cntv.py rename to src/you_get/downloader/cntv.py diff --git a/you_get/downloader/dailymotion.py b/src/you_get/downloader/dailymotion.py similarity index 100% rename from you_get/downloader/dailymotion.py rename to src/you_get/downloader/dailymotion.py diff --git a/you_get/downloader/facebook.py b/src/you_get/downloader/facebook.py similarity index 100% rename from you_get/downloader/facebook.py rename to src/you_get/downloader/facebook.py diff --git a/you_get/downloader/googleplus.py b/src/you_get/downloader/googleplus.py similarity index 100% rename from you_get/downloader/googleplus.py rename to src/you_get/downloader/googleplus.py diff --git a/you_get/downloader/ifeng.py b/src/you_get/downloader/ifeng.py similarity index 100% rename from you_get/downloader/ifeng.py rename to src/you_get/downloader/ifeng.py diff --git a/you_get/downloader/iqiyi.py b/src/you_get/downloader/iqiyi.py similarity index 100% rename from you_get/downloader/iqiyi.py rename to src/you_get/downloader/iqiyi.py diff --git a/you_get/downloader/joy.py b/src/you_get/downloader/joy.py similarity index 100% rename from you_get/downloader/joy.py rename to src/you_get/downloader/joy.py diff --git a/you_get/downloader/ku6.py b/src/you_get/downloader/ku6.py similarity index 100% rename from you_get/downloader/ku6.py rename to src/you_get/downloader/ku6.py diff --git a/you_get/downloader/mixcloud.py b/src/you_get/downloader/mixcloud.py similarity index 100% rename from you_get/downloader/mixcloud.py rename to src/you_get/downloader/mixcloud.py diff --git a/you_get/downloader/netease.py b/src/you_get/downloader/netease.py similarity index 100% rename from you_get/downloader/netease.py rename to src/you_get/downloader/netease.py diff --git a/you_get/downloader/nicovideo.py b/src/you_get/downloader/nicovideo.py similarity index 100% rename from you_get/downloader/nicovideo.py rename to src/you_get/downloader/nicovideo.py diff --git a/you_get/downloader/pptv.py b/src/you_get/downloader/pptv.py similarity index 100% rename from you_get/downloader/pptv.py rename to src/you_get/downloader/pptv.py diff --git a/you_get/downloader/qq.py b/src/you_get/downloader/qq.py similarity index 100% rename from you_get/downloader/qq.py rename to src/you_get/downloader/qq.py diff --git a/you_get/downloader/sina.py b/src/you_get/downloader/sina.py similarity index 100% rename from you_get/downloader/sina.py rename to src/you_get/downloader/sina.py diff --git a/you_get/downloader/sohu.py b/src/you_get/downloader/sohu.py similarity index 100% rename from you_get/downloader/sohu.py rename to src/you_get/downloader/sohu.py diff --git a/you_get/downloader/soundcloud.py b/src/you_get/downloader/soundcloud.py similarity index 100% rename from you_get/downloader/soundcloud.py rename to src/you_get/downloader/soundcloud.py diff --git a/you_get/downloader/tudou.py b/src/you_get/downloader/tudou.py similarity index 100% rename from you_get/downloader/tudou.py rename to src/you_get/downloader/tudou.py diff --git a/you_get/downloader/tumblr.py b/src/you_get/downloader/tumblr.py similarity index 100% rename from you_get/downloader/tumblr.py rename to src/you_get/downloader/tumblr.py diff --git a/you_get/downloader/vimeo.py b/src/you_get/downloader/vimeo.py similarity index 100% rename from you_get/downloader/vimeo.py rename to src/you_get/downloader/vimeo.py diff --git a/you_get/downloader/w56.py b/src/you_get/downloader/w56.py similarity index 100% rename from you_get/downloader/w56.py rename to src/you_get/downloader/w56.py diff --git a/you_get/downloader/xiami.py b/src/you_get/downloader/xiami.py similarity index 100% rename from you_get/downloader/xiami.py rename to src/you_get/downloader/xiami.py diff --git a/you_get/downloader/yinyuetai.py b/src/you_get/downloader/yinyuetai.py similarity index 100% rename from you_get/downloader/yinyuetai.py rename to src/you_get/downloader/yinyuetai.py diff --git a/you_get/downloader/youku.py b/src/you_get/downloader/youku.py similarity index 100% rename from you_get/downloader/youku.py rename to src/you_get/downloader/youku.py diff --git a/you_get/downloader/youtube.py b/src/you_get/downloader/youtube.py similarity index 100% rename from you_get/downloader/youtube.py rename to src/you_get/downloader/youtube.py diff --git a/you_get/main.py b/src/you_get/main.py similarity index 100% rename from you_get/main.py rename to src/you_get/main.py diff --git a/you_get/processor/__init__.py b/src/you_get/processor/__init__.py similarity index 100% rename from you_get/processor/__init__.py rename to src/you_get/processor/__init__.py diff --git a/you_get/processor/ffmpeg.py b/src/you_get/processor/ffmpeg.py similarity index 100% rename from you_get/processor/ffmpeg.py rename to src/you_get/processor/ffmpeg.py diff --git a/you_get/processor/join_flv.py b/src/you_get/processor/join_flv.py similarity index 100% rename from you_get/processor/join_flv.py rename to src/you_get/processor/join_flv.py diff --git a/you_get/processor/join_mp4.py b/src/you_get/processor/join_mp4.py similarity index 100% rename from you_get/processor/join_mp4.py rename to src/you_get/processor/join_mp4.py diff --git a/src/you_get/version.py b/src/you_get/version.py new file mode 100644 index 00000000..0f8a0be6 --- /dev/null +++ b/src/you_get/version.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python + +__version__ = '0.3.1rc' +__date__ = '2013-02-12' diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test.py b/tests/test.py new file mode 100644 index 00000000..c0c8bc0a --- /dev/null +++ b/tests/test.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import unittest + +from you_get import * +from you_get.main import url_to_module + +class YouGetTests(unittest.TestCase): + + def test_googleplus(self): + for url in [ + "http://plus.google.com/111438309227794971277/posts/So6bW37WWtp", + "http://plus.google.com/114038303885145553998/posts/7Jkwa35HZu8", + "http://plus.google.com/109544372058574620997/posts/Hn9P3Mbuyud", + "http://plus.google.com/photos/109544372058574620997/albums/5835145047890484737/5835145057636064194", + "http://plus.google.com/102663035987142737445/posts/jJRu43KQFT5", + "http://plus.google.com/+%E5%B9%B3%E7%94%B0%E6%A2%A8%E5%A5%88/posts/jJRu43KQFT5", + "http://plus.google.com/+平田梨奈/posts/jJRu43KQFT5", + "http://plus.google.com/photos/102663035987142737445/albums/5844078581209509505/5844078587839097874", + "http://plus.google.com/photos/+%E5%B9%B3%E7%94%B0%E6%A2%A8%E5%A5%88/albums/5844078581209509505/5844078587839097874", + "http://plus.google.com/photos/+平田梨奈/albums/5844078581209509505/5844078587839097874", + ]: + url_to_module(url).download(url, info_only = True) + + def test_mixcloud(self): + for url in [ + "http://www.mixcloud.com/beatbopz/beat-bopz-disco-mix/", + "http://www.mixcloud.com/beatbopz/tokyo-taste-vol4/", + "http://www.mixcloud.com/DJVadim/north-america-are-you-ready/", + ]: + url_to_module(url).download(url, info_only = True) diff --git a/you-get b/you-get index da588acc..defa9e4b 100755 --- a/you-get +++ b/you-get @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from you_get import * +from src.you_get import * if __name__ == "__main__": main() diff --git a/you_get/version.py b/you_get/version.py deleted file mode 100644 index 1920b8d5..00000000 --- a/you_get/version.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python - -__version__ = '0.3.0' -__date__ = '2013-02-08'