Giter Club home page Giter Club logo

subredditmediadownloader's Introduction

Hi there, I'm Nico

Profile visitors page views GitHub followers

✨ About Me ✨

I'm a self taught Programmer πŸ‘¨β€πŸ’»

I'm currently working as a freelance software developer πŸš€, mostly making webscrapers πŸ•ΈοΈ and all sort of bots πŸ€–

I'm always curious about new tools I can implement in my programs

What I love the most about programming is automation, and the exciting feeling you get when a hard and boring task disappears with a few lines of code!

πŸ“« How to reach me:

Psycoguana#7354

🌱 I’m currently learning:

πŸ”­ Languages, Frameworks and Tools



Β 

πŸ“Š My Github Stats

Β 

Β 

Β 

Β 

Β 

Β 

⏳ My Time Spent Programming

subredditmediadownloader's People

Contributors

c-vlietstra avatar psycoguana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

subredditmediadownloader's Issues

Download videos with audio

You have a great, fast script, but the videos have not sound.
Video and Audio file in Reddit are 2 different files I want to download both and then will put them together with moviepy .

Video file in Reddit looks like. DASH_720.mp4

Audio for this file is DASH_audio.mp4

with links:

https://v.redd.it/txizu3xq030a1/DASH_720.mp4

https://v.redd.it/txizu3xq030a1/DASH_audio.mp4

I download with limits, if it possible to download not just from new posts, for example from hot posts.
Thank you!
You did a great job.

The API did a update

I not sure if you know that the PushShift API did update and now the script is not working properly, at least in my machine.
image

Script crashing on specific post

Thanks for this great utility, it makes archiving a lot easier.

However, I am currently trying to archive a subreddit, but somehow the script keeps crashing on one specific post:

  • Subreddit: r/scathach
  • Post number is 297 according to the progress bar

Don't really know how to go on from here, as I am unsure what exactly causes this error. One thing could be (from the error paths) that the venv and my normal python installation interfere, but I think that's unlikely. The same issue also occurs in a venv on C

Full trace

Traceback (most recent call last):
  File "D:\General\archiver\subredditMediaDownloader\main.py", line 366, in <module>
    asyncio.run(main())
  File "C:\Program Files\Python311\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "D:\General\archiver\subredditMediaDownloader\main.py", line 353, in main
    await downloader.run()
  File "D:\General\archiver\subredditMediaDownloader\main.py", line 55, in run
    elements = await self.get_elements_info(submissions, total_submissions)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\General\archiver\subredditMediaDownloader\main.py", line 140, in get_elements_info
    if re.search(r'\.(jpg|gif|png)$', sub.url):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\re\__init__.py", line 176, in search
    return _compile(pattern, flags).search(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'

image

AttributeError: 'submission' object has no attribute 'url'

Exec time: 0.90 minutes.
Traceback (most recent call last):
File "/Users/coenraadvlietstra/Downloads/SubredditMediaDownloader-main/main.py", line 313, in
asyncio.run(main())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
return future.result()
File "/Users/coenraadvlietstra/Downloads/SubredditMediaDownloader-main/main.py", line 300, in main
await downloader.run()
File "/Users/coenraadvlietstra/Downloads/SubredditMediaDownloader-main/main.py", line 54, in run
elements = await self.get_elements_info(submissions, total_submissions)
File "/Users/coenraadvlietstra/Downloads/SubredditMediaDownloader-main/main.py", line 135, in get_elements_info
if re.search(r'.(jpg|gif|png)$', sub.url):
AttributeError: 'submission' object has no attribute 'url'

Solution:

If statement at line 135:
if hasattr(sub, 'url'):

'utf-8' codec can't decode byte 0x89 in position 0 Error

Hello, I am currently having an issue with the script. When I get to a set point, I get the following error:

Traceback (most recent call last):
File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 312, in
asyncio.run(main())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 299, in main
await downloader.run()
File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 54, in run
elements = await self.get_elements_info(submissions, total_submissions)
File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 138, in get_elements_info
link = await self.get_real_gif_link(sub.url)
File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 168, in get_real_gif_link
data = data.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

The beginning of the byte file is b'\x89PNG\r\n\x1a (cutting out the rest). Using python 3.10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.