Open peaveyman opened 9 years ago
I figured it out. I leave the subject prefix blank and it will use the folder name as the subject. So now I can put all the folders I want to post in an upload folder and then use a wildcard to post them all without having to run sanguinews for each upload. Sweet deal. I think this can be closed.
It seems like using the wildcard it only uploaded the first folder in the upload folder. Is there a way to make it upload all the folders in the upload folder without having to run sanguinews separately for each folder?
Sanguinews can either upload a directory or files. I never thought about uploading multiple directories at once, because for that particular task I have made my rarnpar script and it could be easily scripted with bash one-liner anyway:
for i in $(ls); do sanguinews -v "$i" ; done
What about recursive mode? Not the behaviour your were looking for?
I'm not sure about recursive mode. What I do is copy the directories to an upload directory. Then I create the par files for each directory. I then name the folders with the scheme I need. So each folder will be named differently. Wouldn't recursive mode just upload each file with it's own name? If so, that wouldn't work for me.
As far as the rarnpar script, can it be made to just par? I don't need the rar as these are music files.
My friend made a guide for rarnpar some time ago which I posted on my site. It should help you with different use case scenarios. I don't remember what I've implemented there yet. But if you need a simple upload of all the directories in your upload folder, then bash one-liner should do the job.
Thanks very much but as far as a bash one-liner, I would have no idea how to do that. I'm sort of a newb with it comes to that stuff. I will look at the guide for rarnpar. Thanks again.
Well, sanguinews needs a guide like rarnpar has. But as with rarnpar, I am waiting till someone will write one and I will (re)post it then. :) P.S. about the one-liner above: it will execute "sanguinews -v"(verbose directory upload) command for each and every non-hidden item in your current directory, but basically, because you are starting it with no "-f" flag, it will upload only directories there.
So your rarnpar script does the rar and par and run sanguinews to upload?
Yes. Or newsmangler. Also has some advanced features. Everything(or almost everything) is explained in the guide I've mentioned above.
Then I gotta figure out how to use it. :) I can create the par files myself with pypar2 or with par2 from the command line but if I can run one command to do it all that would be great. I need to cut out the rar part of rarnpar, then par them, rename them to the naming sequence I need, then upload.
The one liner is doing the trick. It's uploading 3 folders now. Could something be added to it to to delete the folders after it's finished uploading?
Sorry for going off topic here.
for i in $(ls) ; do [ -f "$i" ] && sanguinews -v -f "$i" ; [ -d "$i" ] && sanguinews -v "$i" ; rm -rf "$i" ; done
Upgraded version. It will check if $i is either file, or directory and execute sanguinews with the right options. Afterwards it will delete processed directory or file.
For some reason sanguinews won't upload. Just says unsuccessful. I know I have posting access because jbinup will post using the same credentials. Is there something I can look at?
What options you have enabled there? It could say "Upload of chunk some_number is unsuccessful". It happens for various reasons and it's quite normal. Is the progress bar moving?
The only option I changed was the creation of the nzb file. I changed that to no. Yesterday it uploaded fine. The progress bar isn't moving, it never gets to the progress bar. It's going thru the files and everything is "Upload of chunk some_number is unsuccessful"
Please enable debug mode in the .sanguinews.conf file:
debug = yes
And copy the output afterwards.
I have it enabled. Which output do you want?
I am seeing this output now "441 Posting Failed. Required "From" header is missing E1"
So, it means that your "from" option is misconfigured. It should look like this example:
from = witty_nickname <whatever@example.com>
Notice the form: name
from = Peaveyman News@Newsconnection.local
Like that? That is what I have now in there. With <> like your example.
You did miss <> symbols. I think, I'll be adding option validation soon, because I see how easy it can be to misconfigure something.
The <> are there, just didn't show in the comment.
Here is my config file.
Hm. I can upload files with a from field just like yours. It doesn't make much sense to me then. I'll need your debug output. Enable both "-v"(verbose mode) and debug mode. Wait for a minute to gather all possible error messages. Copy it, remove any private data and upload it somewhere or paste it here.
Here you go.
Well, it definitely looks like that your provider is unhappy with your email. Please try to change it to something more conventionally looking, like "example@gmail.com".
Nope, that didn't work either. And like I said, using the same "From" field jbinup is posting just fine. And sanguinews was working fine yesterday when I tried it.
Ok, this is some strange bug. I would really like to help you, but I am trying to understand what is happening. Can you do one more thing? Open /home/gary/.gem/ruby/2.2.0/gems/sanguinews-0.80/lib/sanguinews/nntp_msg.rb in some text editor, go to line 45 and add between line 45 and 46:
puts header
It should look like
sio.close
puts header
return header
Now the whole header will be printed out during the upload process. Copy and paste it please.
I can copy and paste the huge amount that it gave but I think this is what you want to see:
Encoding Charlie Lucas Band - Not Famous.log
From:
Newsgroups:
Subject: Charlie_Lucas-Not_Famous-Flac-2010 [1/27] - "Charlie Lucas Band - Not Famous.log" yEnc (1/1)
X-Newsposter: sanguinews v0.80 (ruby 2.2.0) - https://github.com/tdobrovolskij/sanguinews
Date: Sat, 07 Feb 2015 07:58:49 -0600
It seems to me it's not reading the .conf file right. I tried copying the sample file over and entering the info again but that didn't work either.
I can not reproduce the bug. Just to be clear, the config file you are talking about is /home/gary/.sanguinews.conf ? With a dot in the beginning of file name(sorry, if question seems dumb, but you told me that you are new to unix), right? Yesterday it was working fine, so did you change anything?
Yes, the config is at /home/gary/.sanguinews.conf
I not totally new to unix just new to trying to write a bash script. And yes, it was working fine yesterday. And as far as I know I didn't change anything. No such thing as a dumb question. :)
Please list your local installed gems:
gem list
Also, considering that I have no more ideas at the moment, you could try to reinstall sanguinews:
gem uninstall sanguinews && gem install sanguinews
gem list
* LOCAL GEMS *
bigdecimal (1.2.6) io-console (0.4.3) json (1.8.1) minitest (5.4.3) nzb (0.2.2) parseconfig (1.0.6) power_assert (0.2.2) psych (2.0.8) rake (10.4.2) rdoc (4.2.0) sanguinews (0.80) speedometer (0.1.3) test-unit (3.0.8)
And the uninstall and reinstall didn't help. Still get the missing header error.
Ok, gems have nothing to do with this. I see that you have the same version of gems which matter installed. sigh
So, we can only proceed with the remote debugging if you are still interested in tracking this bug down :)
Please open /home/gary/.gem/ruby/2.2.0/gems/sanguinews-0.80/lib/sanguinews/config.rb Insert a new line between lines 31 and 32 with the following content:
puts key.to_s + '=' + value.to_s
This part should look like:
value = config[key]
puts key.to_s + '=' + value.to_s
value = true if value == 'yes'
Start to upload something. You will get an output of your config file according to config processing method. Please remove the private data from this output and paste it here.
I am interested in tracking it down. Give me a few minutes and I will report back.
I did as you ask, where will the output be, in the terminal?
Yes, in your terminal, just right at the top. It will look like your config file. If you see no output there, it means that the config file can not be opened by sanguinews. Maybe because of permissions, maybe because of something else.
groups=alt.binaries.sounds.flac,alt.binaries.sounds.lossless.country
from=Peaveyman News@Newsconnection.local
username=
password=
server=
ssl=yes
port=563
connections=20
article_size=768000
reconnect_delay=5
prefix=
nzb=no
header_check=no
debug=yes
xna=no
Encoding Charlie Lucas Band - Which Way To Turn.log
From:
Newsgroups:
Subject: Charlie_Lucas-Which_Way_To_Turn-Flac-2009 [1/26] - "Charlie Lucas Band - Which Way To Turn.log" yEnc (1/1)
X-Newsposter: sanguinews v0.80 (ruby 2.2.0) - https://github.com/tdobrovolskij/sanguinews
Date: Sat, 07 Feb 2015 09:14:23 -0600
I believe that's it
OK, so the initial step is fine. it means that the data is being lost somewhere else. I will think where it could be. Will write back in a moment.
Ok, thanks for taking the time to do this.
Ok, I think that I've found the bug. With disabled nzb creation not all parameters are being processed as they should. I will commit a patch in a matter of minutes. Thank you!
So disabling nzb creation caused the problem? No, thank you!
Please reinstall the gem now. Version 0.80.1 fixes the issue.
Hot dog, you did it!!! Thanks so very much. Now that's what customer support is supposed to be like! :)
Thank you for reporting this strange behaviour of my app! Looks like that no one else tried to upload with nzb creation disabled before.
Does the header check function work? I changed the conf file to make it check the headers and it wouldn't upload. I set it back to no and it's uploading again. Here is the error it gave:
No such article. Maybe server is lagging...(Careless - 01 - Careless.flac / Chunk: 12)
Upload of chunk 12 from file Careless - 01 - Careless.flac unsuccessful. Retrying...
0.0KB/s^C/home/gary/.gem/ruby/2.2.0/gems/sanguinews-0.80.1/lib/sanguinews/thread-pool.rb:99:in join': Interrupt from /home/gary/.gem/ruby/2.2.0/gems/sanguinews-0.80.1/lib/sanguinews/thread-pool.rb:99:in
map'
from /home/gary/.gem/ruby/2.2.0/gems/sanguinews-0.80.1/lib/sanguinews/thread-pool.rb:99:in shutdown' from /home/gary/.gem/ruby/2.2.0/gems/sanguinews-0.80.1/lib/sanguinews.rb:284:in
run!'
from /home/gary/.gem/ruby/2.2.0/gems/sanguinews-0.80.1/bin/sanguinews:4:in <top (required)>' from /home/gary/.gem/ruby/2.2.0/bin/sanguinews:23:in
load'
from /home/gary/.gem/ruby/2.2.0/bin/sanguinews:23:in `
It works as advertised - it makes your upload process slower(sometimes significantly), but it makes sure that the server will report "OK, I got it" for each chunk. So, if server is for some reason under a heavy load, it can take quite a long time. Just leave the upload process running for a longer time and you will see progress there.
If the subject prefix is left as is in the sanguinews.conf file, what does sanguinews use as the subject? Will it use the folder it's posting as the subject? If not, then what?