ronram5126 / steamworkshopdownloader

Simple steam workshop downlaoder
MIT License
22 stars 8 forks source link

Cities Skylines Workshop Collections >.CIVMOD Files #2

Closed hiorbit8 closed 4 years ago

hiorbit8 commented 4 years ago

Hi, When using your program for downloading cities skylines collections, it downloads ".civmod" files, however, it should be in zip files. Do you know why?

Thanks.

Bertik23 commented 4 years ago

I know why it is .civmod but have no idea how to fix it, because I don't know how the downloading works.

But to explain - in index.js there is this line

                    filename: `${packageName.split("/").join("")}.civmod`

Link where is saves the file as .civmod

Edit: And to be clear I TRIED to change it to .zip and it didn't work, it saved as .zip but I couldn't open it.

hiorbit8 commented 4 years ago

Okay thanks! I'll look into it.

Bertik23 commented 4 years ago

I tried something in python, and I'm getting the same issue as when I replaced .civmod with .zip the file is .zip but I can't open it.

Here is the code if you want:

import urllib.request
import requests
from bs4 import BeautifulSoup as soup
import wget

gameId = input("Game ID (the number in the games page on steam like the 255710 in https://store.steampowered.com/app/255710/Cities_Skylines/")
collectionUrl = input("Collection URL")

collesctionSite = soup(requests.get(collectionUrl).text,features="html.parser")
m = 0
for i in collesctionSite.find_all("div","workshopItemTitle"):
    if m == 0:
        collectionName = i.string
        print(collectionName)
    else:
        print(i)
        print(f"http://workshop6.abcvg.info/archive/{gameId}/{i.parent['href'].split('?id=')[1]}")
        #wget.download(f"http://workshop6.abcvg.info/archive/{gameId}/{i.parent['href'].split('?id=')[1]}.zip",f"\downloads\{collectionName}\{i.string}.zip")
        file = requests.get(f"http://workshop6.abcvg.info/archive/{gameId}/{i.parent['href'].split('?id=')[1]}.zip")
        with open(f"C:/Users/alber/Downloads/{collectionName}/{i.string}.zip", "x") as f:
            pass
        with open(f"C:/Users/alber/Downloads/{collectionName}/{i.string}.zip", "wb") as f:
            f.write(file.content)
    m += 1
ronram5126 commented 4 years ago

Hi there, Sorry it was an artifact from my initial project of downloading the civilization mods that I used it for. I have set the default file extension to '.zip' and added a new way to change the extension of downloads.

if you want to change the default file extension from .zip use npm start <new extension> command instead of npm start

Bertik23 commented 4 years ago

Let's say this: It stores the files as .zip but it doesn't work. I tried to open them and it didn't work.

hiorbit8 commented 4 years ago

Indeed, I tried again too and it didn't work either. Hope you find a solution.

ronram5126 commented 4 years ago

Hmm.. Could you please provide me links to workshop you are trying to download... I will check it.

hiorbit8 commented 4 years ago

Here you go: https://steamcommunity.com/sharedfiles/filedetails/?id=524840544

Bertik23 commented 4 years ago

Or if you want something smaller https://steamcommunity.com/workshop/filedetails/?id=526561660

ronram5126 commented 4 years ago

Hey guys, Sorry i was busy, but I have updated the repo and tested it with the given collections.

Thanks for patience, stay safe, Ronit.

hiorbit8 commented 4 years ago

Hi,

Just tested it and it now works perfectly!

Thanks for your work and support, stay home, stay safe, ORBIT.