GithubHelp home page GithubHelp logo

glazec / daily_pics Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 11 KB

This project aims to help you download your favorite/likes images from Twitter and Pixiv. Everytime you run it, it will only download your latest likes into corresponding date folder in assets.

Python 100.00%
pixiv twitter imags likes favorite pixiv-downloader

daily_pics's Introduction

This project aims to help you download your favorite/likes images from Twitter and Pixiv. Everytime you run it, it will only download your latest likes into corresponding date folder in assets.

features

  • easily save your likes with highest quality without repetition and review them anytime you want.
  • Put all relating information, author, title, tag, links, create date into image metadata. Never Lose It.
  • Automatically generate image excerpt as digest.png.

How to use it

  1. If you want to download likes from twitter, you need to apply twitter api keys.
  2. Install requirements. pip install -r requirements.txt.
  3. Write your information into config.json
  4. Run main.py in command line

Contribution

Feel free to make it possible to download likes from other websites, like dribble.

A few things to notice:

  1. Put all caches into caches folder and following the name website_yourname_likes.json
  2. Download images into correct location
    # create current date folder. Correct the date for late night.
    current_date = '0'
    if datetime.datetime.now().hour < 3:
        current_date = date.today()-datetime.timedelta(days=1)
    else:
        current_date = date.today()
    if not os.path.exists(f'assets/{current_date}'):
        os.makedirs(f'assets/{current_date}')
  1. Put information into metadata with pyexiv2.
def xmp_edit(illust, img_path):
    img = Image(
        img_path, encoding='utf-8')
    tags = []
    for i in illust.tags:
        if i['translated_name'] == None:
            tags.append(i['name'])
        else:
            tags.append(i['translated_name'])
    print(tags)
    xmp_data = {
        'Xmp.dc.creator': [illust.user.name],
        'Xmp.dc.description': illust.caption,
        'Xmp.dc.title': illust.title,
        # 'Xmp.photoshop.Category': illust.type,
        'Xmp.photoshop.DateCreated': str(illust.create_date),
        'Xmp.photoshop.Source': f'https://www.pixiv.net/artworks/{illust.id}',
        'Xmp.xmp.Label': ','.join(tags),

    }
    img.modify_xmp(xmp_data)
    img.close()
  1. Get necessary information from config.json.

If you don't know where to start, you can follow the code pattern of existed scripts, plugins/pixiv/pixiv.py and plugins/twitter/twitter.py.

daily_pics's People

Contributors

glazec avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.