From 054b91b1c690e43ec832aaaf1f8807357ee13d0c Mon Sep 17 00:00:00 2001 From: Voussoir Date: Sat, 16 May 2015 03:31:00 -0700 Subject: [PATCH] else --- TotalDL/!!testdata.db | Bin 5120 -> 6144 bytes TotalDL/timesearch_dl.py | 13 ++++- TotalDL/totaldl.py | 104 +++++++++++++++++++-------------------- 3 files changed, 62 insertions(+), 55 deletions(-) diff --git a/TotalDL/!!testdata.db b/TotalDL/!!testdata.db index 8813fc88759a90ba3ac7394bec30992cef340263..60a64eb411207c182aeb0947345d99e6c0aa3c0d 100644 GIT binary patch delta 309 zcmZqBXfT){Ehxpnz`zE?Fu*)f$5>d3LH8LmFHne?DVKri2h%pD+>M3589m*Z*~C>< z8G}m_lX6l^@=FqPQgY%;i*kyQ*=){1u8twD3L%b8KCTMLG8#ao3L&l$A)1@FF?k8f zfo$Mr(qLdd&%BYjhS`^yi|HZLQKrRA?M$gm8XF6_m{_d2nd&Fs6|{6x;9~O3C@Cqh z($~+_%gjwLEz(QQ&(+UxvM4KYPt+^OOPAtgvW2OD%O~o)S{j%ZD{wG*PWBg;W07KK zvYq@uSb{~JjVXNcTozSUM^@%W&dDOIb}YIqOv#gXv1+pzGc)B+u4FT0kzrzTocxDP OibbE1DSh%(c3l9(2~foV delta 55 zcmZoLXwaA-Ey%~fz`zQ`Fu*iX#~3K6`;3_vD8$6Hje+S0)3(iu9BxdTw=sDM0s!7Q B39<|.': title = title.replace(character, '') if len(title) > 35: title = title[:34] + '-' - url = item[7] - totaldl.handle_master(url, customname=title) \ No newline at end of file + totaldl.handle_master(url, customname=title) + cur2.execute('INSERT INTO totaldl_urls VALUES(?)', [url]) + sql.commit() \ No newline at end of file diff --git a/TotalDL/totaldl.py b/TotalDL/totaldl.py index b35100c..1fbda01 100644 --- a/TotalDL/totaldl.py +++ b/TotalDL/totaldl.py @@ -274,76 +274,74 @@ def handle_master(url, customname=None): if DO_GENERIC: handle_generic(url, customname=customname) -def test(imgur=True, gfycat=True, vimeo=True, liveleak=True, youtube=True, generic=True): - print('Testing') - if imgur: - # Imgur gallery album - handle_master('http://imgur.com/gallery/s4WLG') +def test_imgur(): + # Imgur gallery album + handle_master('http://imgur.com/gallery/s4WLG') - # Imgur standard album with customname - handle_master('http://imgur.com/a/s4WLG', customname='album') + # Imgur standard album with customname + handle_master('http://imgur.com/a/s4WLG', customname='album') - # Imgur indirect - handle_master('http://imgur.com/gvJUct0') + # Imgur indirect + handle_master('http://imgur.com/gvJUct0') - # Imgur indirect single with customname - handle_master('http://imgur.com/gvJUct0', customname='indirect') + # Imgur indirect single with customname + handle_master('http://imgur.com/gvJUct0', customname='indirect') - # Imgur direct single - handle_master('http://i.imgur.com/gvJUct0.jpg') + # Imgur direct single + handle_master('http://i.imgur.com/gvJUct0.jpg') - if gfycat: - # Gfycat direct .gif - handle_master('http://giant.gfycat.com/FatherlyBruisedIberianchiffchaff.gif') +def test_gfycat(): + # Gfycat direct .gif + handle_master('http://giant.gfycat.com/FatherlyBruisedIberianchiffchaff.gif') - # Gfycat general link - handle_master('http://www.gfycat.com/RawWetFlatcoatretriever') + # Gfycat general link + handle_master('http://www.gfycat.com/RawWetFlatcoatretriever') - # Gfycat general link with customname - handle_master('http://www.gfycat.com/RawWetFlatcoatretriever', customname='gfycatgeneral') + # Gfycat general link with customname + handle_master('http://www.gfycat.com/RawWetFlatcoatretriever', customname='gfycatgeneral') - if vimeo: - # Vimeo standard link - handle_master('https://vimeo.com/109405701') +def test_vimeo(): + # Vimeo standard link + handle_master('https://vimeo.com/109405701') - # Vimeo player link with customname - handle_master('https://player.vimeo.com/video/109405701', customname='vimeoplayer') + # Vimeo player link with customname + handle_master('https://player.vimeo.com/video/109405701', customname='vimeoplayer') - if liveleak: - # LiveLeak standard link - handle_master('http://www.liveleak.com/view?i=9d1_1429192014') +def test_liveleak(): + # LiveLeak standard link + handle_master('http://www.liveleak.com/view?i=9d1_1429192014') - # Liveleak article with youtube embed - handle_master('http://www.liveleak.com/view?i=ab8_1367941301') + # Liveleak article with youtube embed + handle_master('http://www.liveleak.com/view?i=ab8_1367941301') - # LiveLeak standard link with customname - handle_master('http://www.liveleak.com/view?i=9d1_1429192014', customname='liveleak') + # LiveLeak standard link with customname + handle_master('http://www.liveleak.com/view?i=9d1_1429192014', customname='liveleak') - if youtube: - # Youtube standard link - handle_master('https://www.youtube.com/watch?v=bEgeh5hA5ko') +def test_youtube(): + # Youtube standard link + handle_master('https://www.youtube.com/watch?v=bEgeh5hA5ko') - # Youtube short link - handle_master('https://youtu.be/GjOBTstnW20') + # Youtube short link + handle_master('https://youtu.be/GjOBTstnW20') - # Youtube player embed link - handle_master('https://www.youtube.com/watch?feature=player_embedded&v=bEgeh5hA5ko') + # Youtube player embed link + handle_master('https://www.youtube.com/watch?feature=player_embedded&v=bEgeh5hA5ko') - if generic: - # Some link that might work - handle_master('https://raw.githubusercontent.com/voussoir/reddit/master/SubredditBirthdays/show/statistics.txt') +def test_generic(): + # Some link that might work + handle_master('https://raw.githubusercontent.com/voussoir/reddit/master/SubredditBirthdays/show/statistics.txt') - # Some link that might work with customname - handle_master('https://raw.githubusercontent.com/voussoir/reddit/master/SubredditBirthdays/show/statistics.txt', customname='sss') + # Some link that might work with customname + handle_master('https://raw.githubusercontent.com/voussoir/reddit/master/SubredditBirthdays/show/statistics.txt', customname='sss') - # Some link that might work - handle_master('https://github.com/voussoir/reddit/tree/master/SubredditBirthdays/show') + # Some link that might work + handle_master('https://github.com/voussoir/reddit/tree/master/SubredditBirthdays/show') if __name__ == '__main__': - test( - imgur=False, - gfycat=False, - vimeo=False, - liveleak=False, - youtube=True, - generic=False) \ No newline at end of file + #test_imgur() + #test_gfycat() + #test_vimeo() + #test_liveleak() + #test_youtube() + #test_generic() + pass \ No newline at end of file