GithubHelp home page GithubHelp logo

Comments (10)

jniggemann avatar jniggemann commented on May 28, 2024 1

Correctly using slashes instead of backslashes, there's no longer an error.

from kleinanzeigen-bot.

sebthom avatar sebthom commented on May 28, 2024

Hmm, I cannot reproduce, seems to work fine for me.

[INFO] App version: 0.1.dev1+ga5347fc
[INFO] Loading config from [D:\kleinanzeigen-bot\data\config.yaml]...
[INFO]  -> found 75 categories
[INFO] Searching for ad config files...
[INFO]  -> found 4 ad config files

How does your config.yaml look like?

from kleinanzeigen-bot.

sebthom avatar sebthom commented on May 28, 2024

Just republished some more ads, worked fine.

from kleinanzeigen-bot.

domlysi avatar domlysi commented on May 28, 2024

I have the same problem running the binary and the docker instance:

INFO] Logging to [/mnt/data/kleinanzeigen-bot.log]...
[INFO] App version: 0.1.dev1+g7e6fbfe.d20220622
[INFO] Loading config from [/mnt/data/config.yaml]...
[INFO]  -> found 75 categories
[INFO] Searching for ad config files...
[INFO]  -> found 0 ad config files
[INFO] ############################################
[INFO] DONE: No new/outdated ads found.
[INFO] ############################################
ad_files:
  - '**/ad_*.{json,yml,yaml}'

# default values for ads, can be overwritten in each ad configuration file
ad_defaults:
  active: true
  type: OFFER # one of: OFFER, WANTED
  description:
    prefix: ''
    suffix: ''
  price_type: NEGOTIABLE # one of: FIXED, NEGOTIABLE, GIVE_AWAY, NOT_APPLICABLE
  shipping_type: SHIPPING # one of: PICKUP, SHIPPING, NOT_APPLICABLE
  contact:
    name: ''
    street: ''
    zipcode:
    phone: '' # IMPORTANT: surround phone number with quotes to prevent removal of leading zeros
  republication_interval: 7 # every X days ads should be re-published

# additional name to category ID mappings, see default list at
# https://github.com/Second-Hand-Friends/kleinanzeigen-bot/blob/main/kleinanzeigen_bot/resources/categories.yaml
# Notebooks: 161/278 # Elektronik > Notebooks
# Autoteile: 210/223/sonstige_autoteile # Auto, Rad & Boot > Autoteile & Reifen > Weitere Autoteile
categories: []

# browser configuration
browser:
  # https://peter.sh/experiments/chromium-command-line-switches/
  arguments:
    # https://stackoverflow.com/a/50725918/5116073
    - --disable-dev-shm-usage
    - --no-sandbox
    # --headless
    # --start-maximized
  binary_location: # path to custom browser executable, if not specified will be looked up on PATH
  extensions: [] # a list of .crx extension files to be loaded
  use_private_window: true
  user_data_dir: '' # see https://github.com/chromium/chromium/blob/main/docs/user_data_dir.md
  profile_name: ''

# login credentials
login:
  username: *******
  password: ******

from kleinanzeigen-bot.

sebthom avatar sebthom commented on May 28, 2024

@domlysi where are the ad files located in this example? directly in /mnt/data/ or in a subdirectory?
what is the pattern you used to name your ad files? E.g. ad_XYZ.yml

from kleinanzeigen-bot.

jniggemann avatar jniggemann commented on May 28, 2024

@sebthom: Error also present in version: 0.1.dev1+g7e6fbfe
Just exchanging the binary and running 0.1.dev1+g2a28cc4.d20220531 works fine.

There are only 4 commits between 0.1.dev1+g7e6fbfe and 0.1.dev1+ga5347fc, I could test if you sent me the executables.

from kleinanzeigen-bot.

sebthom avatar sebthom commented on May 28, 2024

The issue was probably introduced by f924ed8 where I changed the globbing library.

However since I cannot reproduce the issue I don't know what to fix.

What happens if you change:

ad_files:
  - "**/ad_*.{json,yml,yaml}"

back to

ad_files:
  - "**/ad_*.json"
  - "**/ad_*.yaml"
  - "**/ad_*.yml"

?

from kleinanzeigen-bot.

jniggemann avatar jniggemann commented on May 28, 2024

Could get app version: 0.1.dev1+g4e8cb9c to work, it seems to be the globbing lib indeed.

Before

  • EXE in D:\xxx\yyy\Programme\ebay
  • ads in D:\xxx\yyy\Programme\ebay\ads
  • images in D:\xxx\yyy\Programme\ebay\ads\img
  • config.yaml contained
ad_files:
  - "ads/**/ad_*.yml"
  • ad_xxx.yml contained
images:
  - img\ad1_*.JPG

Now (working with 0.1.dev1+g4e8cb9c)

  • EXE in D:\xxx\yyy\Programme\ebay
  • ads in D:\xxx\yyy\Programme\ebay\ads
  • images in D:\xxx\yyy\Programme\ebay\ads (<- all images directly in here, no longer in a subfolder)
  • config.yaml contains
ad_files:
  - "ads/ad_*.yml"
  • ad_xxx.yml contains
images:
  - ad1_*.JPG

Having both, the ads and img folder in D:\xxx\yyy\Programme\ebay did not work, no matter how I included the images in the ad.

I'd like it, if we could somehow keep ads and images in different folders. Helps me to better manage the files.

from kleinanzeigen-bot.

sebthom avatar sebthom commented on May 28, 2024

@jniggemann better don't use backslashes as directory separator in the pattern, just use slashes.
a) backslashes they need to be escaped in YAML files, like \ -> \\ if the string is surrounded by quotes (" or ')
b) the globbing library also expects backslashes to be escaped if they symbolize a directory separator

images:
  - "img\\\\ad1_*.JPG"     # <- double escape backslashes in quoted strings
  - img\\ad1_*.JPG         # <- single escape backslashes in unquoted strings

Also, just to be clear: your previously working file structure looked like this

D:\xxx\yyy\Programme\ebay
   |- kleinanzeigen-bot.exe
   |- config.yml  # contains:  ad_files: -"ads/**/ad_*.yml"
   |- ads\
      |- ad_1_XYZ.yml  # contains:  images: -"img/ad1_*.JPG"
      |- ads\img\
         |- ad1_some_name.JPG

and you run the exe in a command line window where you CDed into D:\xxx\yyy\Programme\ebay, like this:

D:\xxx\yyy\Programme\ebay> kleinanzeigen-bot.exe --config config.yml

from kleinanzeigen-bot.

jniggemann avatar jniggemann commented on May 28, 2024

better don't use backslashes as directory separator in the pattern, just use slashes.

Now that you say it, I remember... Single backslashes were automatically replaced by double backslashes in the inquoted strings I use.

Also, just to be clear: your previously working file structure looked like this

D:\xxx\yyy\Programme\ebay
   |- kleinanzeigen-bot.exe
   |- config.yml  # contains:  ad_files: -"ads/**/ad_*.yml"
   |- ads\
      |- ad_1_XYZ.yml  # contains:  images: -"img/ad1_*.JPG"
      |- ads\img\
         |- ad1_some_name.JPG

and you run the exe in a command line window where you CDed into D:\xxx\yyy\Programme\ebay, like this:

D:\xxx\yyy\Programme\ebay> kleinanzeigen-bot.exe --config config.yml

Correct with the only exception being I run it as D:\xxx\yyy\Programme\ebay> kleinanzeigen-bot.exe publish without specifying the config file which gets picked up automatically.

from kleinanzeigen-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.