test.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/usr/bin/env python
  2. import unittest
  3. from you_get.extractors import (
  4. imgur,
  5. magisto,
  6. youtube,
  7. missevan,
  8. acfun,
  9. bilibili,
  10. soundcloud,
  11. tiktok,
  12. twitter,
  13. miaopai
  14. )
  15. class YouGetTests(unittest.TestCase):
  16. def test_imgur(self):
  17. imgur.download('http://imgur.com/WVLk5nD', info_only=True)
  18. imgur.download('https://imgur.com/we-should-have-listened-WVLk5nD', info_only=True)
  19. def test_magisto(self):
  20. magisto.download(
  21. 'http://www.magisto.com/album/video/f3x9AAQORAkfDnIFDA',
  22. info_only=True
  23. )
  24. #def test_youtube(self):
  25. #youtube.download(
  26. # 'http://www.youtube.com/watch?v=pzKerr0JIPA', info_only=True
  27. #)
  28. #youtube.download('http://youtu.be/pzKerr0JIPA', info_only=True)
  29. #youtube.download(
  30. # 'http://www.youtube.com/attribution_link?u=/watch?v%3DldAKIzq7bvs%26feature%3Dshare', # noqa
  31. # info_only=True
  32. #)
  33. #youtube.download(
  34. # 'https://www.youtube.com/watch?v=oRdxUFDoQe0', info_only=True
  35. #)
  36. def test_acfun(self):
  37. acfun.download('https://www.acfun.cn/v/ac44560432', info_only=True)
  38. #def test_bilibili(self):
  39. #bilibili.download('https://www.bilibili.com/video/BV1sL4y177sC', info_only=True)
  40. #def test_soundcloud(self):
  41. ## single song
  42. #soundcloud.download(
  43. # 'https://soundcloud.com/keiny-pham/impure-bird', info_only=True
  44. #)
  45. ## playlist
  46. #soundcloud.download(
  47. # 'https://soundcloud.com/anthony-flieger/sets/cytus', info_only=True
  48. #)
  49. def test_tiktok(self):
  50. tiktok.download('https://www.tiktok.com/@zukky_48/video/7398162058153315605', info_only=True)
  51. tiktok.download('https://www.tiktok.com/@/video/7398162058153315605', info_only=True)
  52. tiktok.download('https://t.tiktok.com/i18n/share/video/7398162058153315605/', info_only=True)
  53. tiktok.download('https://vt.tiktok.com/ZSYKjKt6M/', info_only=True)
  54. def test_twitter(self):
  55. twitter.download('https://twitter.com/elonmusk/status/1530516552084234244', info_only=True)
  56. twitter.download('https://x.com/elonmusk/status/1530516552084234244', info_only=True)
  57. def test_weibo(self):
  58. miaopai.download('https://video.weibo.com/show?fid=1034:4825403706245135', info_only=True)
  59. if __name__ == '__main__':
  60. unittest.main()