[padma-dev] uploading videos

Nagarjuna G nagarjun at gnowledge.org
Thu Mar 11 08:36:56 CET 2010

On Wed, Mar 10, 2010 at 3:26 PM, Sanjay Bhangar <sanjaybhangar at gmail.com> wrote:
> Hey,
> Sorry for the late response --

Thanks Sanjay for the detailed instructions.  that is more than
enough.  we will write a python script for the same and share with
you.  I subscribed to the dev list.  will forward your reply there as


> On Mon, Mar 8, 2010 at 11:22 AM, Nagarjuna G <nagarjun at gnowledge.org> wrote:
>> The site seems to be working just fine.  so we want to upload several
>> of the videos, and launch for public use very soon.
> Yay :)
>>  Is there a way to upload them from the server's shell, such as all
>> files in a folder?   Also, if such a procedure is possible, how do we
>> set the ownership/contributor of the video to one of the users?
> So all this is definitely possible from the shell. Unfortunately, our
> specific work-flows have in most cases been slightly different, but
> hopefully its not too hard to write some scripts to do this ..
> So, in our old work-flow, our procedure would be this:
> Our Directory structure would be something like:
> Gnowledge/
>   ogg/
>   xml/
> The ogg/ folder would hold all the ogv files, and the xml folder would hold
> corresponding .xml files with the metadata for the videos. To get an idea of
> the xml format, you can see http://pad.ma/Vdy5qr4j/xml (
> http://pad.ma/<video_id>/xml ). We don't really use this XML import method
> any more as we've moved to using the web interface and .srt files, but the
> code lives in padma/padma/import_xml.py
> When using this script, we would do:
> tg-admin shell
>> import_new('/path/to/Gnowledge/ogg')   <-- assuming above directory
>> structure
> And this would then create the smaller ogg versions and import the metadata
> from the corresponding xml file.
> You can look at this script and see if you can tweak it to do what you need.
> Jan had an idea to use a python client and just make POST requests to the
> /upload page . Maybe he can shed more light on this..
> In general, on the shell, to change things in the video, you would do
> something like:
> tg-admin shell
>> v = Video.by_hid('<video_id>')         <-- eg. v =
>> Video.by_hid('Vdy5qr4j')
> Then you can do things like:
>> u = User(id=foo)
>> v.contributor = u
> You can look up the properties and methods for the Video class in
> padma/padma/model.py to get an idea of what methods you can run and what
> properties can be set.
> To see how we currently add a video to the system when a user uploads, look
> at padma/padma/upload.py - line 41 - def add ...
> Hopefully this makes sense.
> Hopefully we can also migrate this discussion to our dev mailing list -
> Sorry, we were having some problems, but we re-setup everything yesterday
> and should work fine. You can subscribe @
> https://mailb.org/cgi-bin/mailman/listinfo/dev  or by sending an email to
> dev-subscribe at pad.ma .
> Let me know if there's anything I can help with. Sorry again for the late
> reply. Jan left this morning and was trying to get as much as possible done
> with him before he left :)
> All the best,
> Sanjay
>> --
>> GN

More information about the dev mailing list