Skip to content

Commit

Permalink
Merge pull request #90 from mvdicarlo/develop
Browse files Browse the repository at this point in the history
v2.3.34
  • Loading branch information
mvdicarlo authored Jul 18, 2021
2 parents b916baa + 6f89358 commit 9c665d5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postybirb",
"version": "2.3.33",
"version": "2.3.34",
"description": "PostyBirb is an application that helps artists post art and other multimedia to multiple websites more quickly.",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postybirb",
"version": "2.3.33",
"version": "2.3.34",
"scripts": {
"ng": "ng",
"compile": "ng build --vendor-chunk=false",
Expand Down
19 changes: 14 additions & 5 deletions src/app/websites/website-services/weasyl/weasyl.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,19 @@ export class Weasyl extends BaseWebsiteService implements WebsiteService {
const journalPage: string = response.body;

const data = {
token: HTMLParser.getInputValue(journalPage, 'token'),
title: postData.title,
rating: this.getRating(postData.rating),
content: postData.description,
tags: this.formatTags(postData.tags, [])
}

const postResponse = await got.post(`${this.BASE_URL}/submit/journal`, data, this.BASE_URL, cookies);
const postResponse = await got.post(`${this.BASE_URL}/submit/journal`, data, this.BASE_URL, cookies, {
headers: {
Referer: `${this.BASE_URL}/submit/journal`,
Origin: 'https://www.weasyl.com',
Host: 'www.weasyl.com',
}
});
if (postResponse.error) {
return Promise.reject(this.createPostResponse(postResponse.error.message, postResponse.error.stack));
} else {
Expand All @@ -215,13 +220,11 @@ export class Weasyl extends BaseWebsiteService implements WebsiteService {
const submissionPage: string = response.body;

const data: any = {
token: HTMLParser.getInputValue(submissionPage, 'token'),
title: postData.title,
rating: this.getRating(postData.rating),
content: postData.description,
tags: this.formatTags(postData.tags, []),
submitfile: fileAsFormDataObject(postData.primary),
redirect: url
}

if (postData.thumbnail) {
Expand All @@ -244,7 +247,13 @@ export class Weasyl extends BaseWebsiteService implements WebsiteService {
data.folderid = options.folder || '';
data.subtype = options.category || '';

const postResponse = await got.post(url, data, this.BASE_URL, cookies);
const postResponse = await got.post(url, data, this.BASE_URL, cookies, {
headers: {
Referer: url,
Origin: 'https://www.weasyl.com',
Host: 'www.weasyl.com',
},
});
if (postResponse.error) {
return Promise.reject(this.createPostResponse(postResponse.error.message, postResponse.error.stack));
} else {
Expand Down

0 comments on commit 9c665d5

Please sign in to comment.