animetosho / Nyuu

Flexible usenet binary posting tool
221 stars 32 forks source link

How can I have the folder name as the subject for the comment? #34

Closed shillshocked closed 2 years ago

shillshocked commented 6 years ago

I was looking at the options, but I didn't see one for current uploading directory.

If I upload a bunch of folders recursively with files in them, I want each one to have the title of the folder in the subject post.

Ie. Folder 1 --> "Joe Blow's Car Chase" with a bunch of avis Folder 2 --> "Aunt Mammy's Rocking Chair" with another bunch of avis

Instead of copying and pasting the subject and running nyuu for each folder, can I insert the folder name as a subject in each one somehow?

animetosho commented 6 years ago

Assuming you mean that you want to do this to each folder in the current directory, but not in a recursive manner, you could use a command like:

find -mindepth 1 -maxdepth 1 -type d -exec sh -c 'nyuu [options] -t "`basename $0`" "$0"' {} \;

If you do want to repeat this recursively, remove -maxdepth 1 from the command.

shillshocked commented 6 years ago

But how could I do this so it would just run one nyuu task per folder? I want to keep the running count so that people know which files to download.

animetosho commented 6 years ago

I'm not really sure what you mean. Can you give a more thorough explanation and example?

shillshocked commented 6 years ago

Alright, if I used find in this method, each file will be file#.ext [1/1] But with a normal post it would be file#.ext [file#/totalfiles]

animetosho commented 6 years ago

Which is what Nyuu does by default...
I'm sorry, but if you want me to actually understand what you want, you'll need to give a thorough explanation.

If I were to make a guess, is this what you want?

Folder structure:

mydir1
    file1.ext
    file2.ext
mydir2
    file3.ext
    file4.ext

You want the corresponding Subjects of these four files to be like:

mydir1 [1/2] "file1.ext" yEnc (1/100)
mydir1 [1/2] "file2.ext" yEnc (1/100)
mydir2 [2/2] "file3.ext" yEnc (1/100)
mydir2 [2/2] "file4.ext" yEnc (1/100)

Is that correct? If so, a bash script should be able to do it. If not, please explain clearly what you want.

shillshocked commented 6 years ago

No, I want it this way:

mydir1 [1/2] "file1.ext" yEnc (1/100)
mydir1 [2/2] "file2.ext" yEnc (1/100)
mydir2 [1/2] "file3.ext" yEnc (1/100)
mydir2 [2/2] "file4.ext" yEnc (1/100)
animetosho commented 6 years ago

See my first comment above

kuku5hka commented 6 years ago

i'm pretty sure it's a bit outside of what nyuu should do cause it can be easily reached with OS scripts, like "for" loop within batch or bash scripts with folder name passed to nyuu as a parameter