Commons:Feltöltés parancssorból

This page is a translated version of a page Commons:Command-line upload and the translation is 69% complete. Changes to the translation template, respectively the source language can be submitted through Commons:Command-line upload and have to be approved by a translation administrator.

A Wikimédia Commonsra parancssoros eszközökkel is lehetséges feltölteni.

Script Dependencies Batch upload {{Information}} support
Nichalp's Upload Script Perl Yes 7 licenses
Anuta Perl, Python and csv_creator.pl Yes 7 licenses
Simple Commons Uploader Python Yes only Cc-by-sa-2.0
upload.py from Pywikibot Python No none

Nichalp feltöltőszkriptje

A Perl-szkript egy könyvtárban található fotók listájából hoz létre CSV-állományt, amely a leírást, licencet, kategóriát, helyadatokat és másokat tartalmaz. A szkript képes néhány EXIF-adat (például GPS-koordináták, név, licenc stb…) mellékelésére is. A képek elforgathatók és átnevezhetőek.

Wmigda feltöltőszkriptje

Az előbbi szakaszban tárgyalt szkript Python-verziója, de a Nichalp szkriptjeinek egyike által generált upload.csv fájlt használja.

Követelmények: Pearl, Python és Nichalp egyik szkripte; továbbiakért lásd a dokumentációt

Fastily's upload script

A Python program which can upload whole folders on your computer with basic information and a category (determined by the name of the enclosing folder).

Tools to upload files from other websites

Flickrripper

A Flickrripper egy Python nyelven íródott szabad szoftver, mellyel a Flickrről nagy mennyiségű kép tölthető át a Wikimédia Commonsra. A leíráshoz kövesd a szakaszcímben található hivatkozást.

Phython Wikipédia-bot

A Python-keretrendszer számos feltöltési eszközt tartalmaz; ezekhez a Python és a Pywikibot telepítése szükséges. Ha minden feltöltést ellenőrzöl (lásd a verifyDescription opciót alább), akkor az nem számít botos feltöltésnek.

A használatról szóló részletes leírás:

Az eszközzel való bejelentkezéshez a konfigurációs állománynak az alábbiakat kell tartalmaznia:

family = 'commons'
mylang = 'commons'
usernames['commons']['commons'] = 'nick'

Használat:

Az UploadRobot saját szkripttel való használatának mintája
# -*- coding: utf-8  -*-

import sys

import pywikibot
from pywikibot.specialbots import UploadRobot

def complete_desc_and_upload(filename, pagetitle, desc, date, categories):
    #complete this once if applies to all files

    description = u"""{{Information
|Description    = {{en|1=""" + desc + """}}
|Source         = <!-- if applicable: {{own}} --->
|Author         = <!-- your name:  --->
|Date           = """ + date + """
|Permission     = 
|other_versions = 
}}
=={{int:license-header}}==
<!-- your license --->

""" + categories + """
[[Category:Taken with camera 123]]
"""
    url = [ filename ]
    keepFilename = False        #set to True to skip double-checking/editing destination filename
    verifyDescription = True    #set to False to skip double-checking/editing description => change to bot-mode
    targetSite = pywikibot.getSite('commons', 'commons')
    
    bot = UploadRobot(url, description=description, useFilename=pagetitle, keepFilename=keepFilename, verifyDescription=verifyDescription, targetSite=targetSite)
    bot.run()

def main(args):
    #list each file here
    
    filename    = """testimage-1.jpg"""
    pagetitle   = """testimage-1-from asdfasdfa.jpg"""
    desc        = """Mount St Helens viewed from ... in the rain"""
    date        = "2010-04-07"
    categories  = """[[Category:Locality]]
[[Category:Theme]]
[[Category:View type]]
[[Category:Feature1]]
[[Category:Feature2]]"""
    complete_desc_and_upload(filename, pagetitle, desc, date, categories)


    #sample with:  - local file name identical to file name at Commons
    #              - date as previous file
    #              - less quotes (no CR or " in fields)
    filename   = "testimage-2.jpg"
    pagetitle  = filename
    desc       = "Mount St Helens as seen from ... at sunset"
    categories = "[[Category:Locality]] [[Category:Theme]] [[Category:View type]] [[Category:Feature1]] [[Category:Feature2]]"
    complete_desc_and_upload(filename, pagetitle, desc, date, categories)
   

if __name__ == "__main__":
    try:
        main(sys.argv[1:])
    finally:
        pywikibot.stopme()

Egyéb, a pywikipediaboton alapuló eszközökhöz lásd: multichill/bot és erfgoedbot.

BotClasses.php

Néhány bot (például User:BrooklynMuseumBot) a BotClasses.php PHP-kódját alapul véve íródott.